Fix access control on PHP 8.4 #96
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: [push, pull_request] | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| php: ['8.1', '8.2', '8.3', '8.4'] | |
| db: ['mysql', 'sqlite'] | |
| name: PHP ${{ matrix.php }} + ${{ matrix.db}} | |
| services: | |
| mysql: | |
| image: mysql:8 | |
| env: | |
| MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
| MYSQL_DATABASE: phproject | |
| ports: | |
| - 3306/tcp | |
| options: >- | |
| --health-cmd "mysqladmin ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 3 | |
| steps: | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| env: | |
| COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/checkout@v3 | |
| - uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-composer | |
| with: | |
| path: ~/.composer | |
| key: ${{ runner.os }}-ci-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-ci-${{ env.cache-name }}- | |
| ${{ runner.os }}-ci- | |
| ${{ runner.os }}- | |
| - name: Syntax check | |
| run: if find . -name "*.php" ! -path "./vendor/*" -exec php -l {} 2>&1 \; | grep "syntax error, unexpected"; then exit 1; fi | |
| - name: Composer | |
| run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | |
| - run: vendor/bin/phpcs | |
| - if: matrix.db == 'mysql' | |
| name: Install Phproject (MySQL) | |
| run: php install.php --site-name=Test --site-url=http://localhost/ --timezone=America/Phoenix --admin-username=test [email protected] --admin-password=secret --db-host=127.0.0.1 --db-port=${{ job.services.mysql.ports['3306'] }} --db-user=root | |
| - if: matrix.db == 'sqlite' | |
| name: Install Phproject (SQLite) | |
| run: php install.php --site-name=Test --site-url=http://localhost/ --timezone=America/Phoenix --admin-username=test [email protected] --admin-password=secret --db-engine=sqlite --db-name=database.sqlite | |
| - name: PHPUnit tests | |
| run: vendor/bin/phpunit --no-progress |