Make PHP 8.3 to minimum PHP version. #43
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: Continuous Integration | |
| on: | |
| - pull_request | |
| - push | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php: | |
| - 8.3 | |
| - 8.4 | |
| - 8.5 | |
| dependencies: | |
| - "--prefer-lowest" | |
| - "" | |
| name: PHP ${{ matrix.php }} Test ${{ matrix.dependencies }} | |
| services: | |
| mysql: | |
| image: mysql:5.7 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| ports: | |
| - 3306:3306 | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: none | |
| - name: Validate composer.json | |
| run: composer validate | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ matrix.dependencies }}- | |
| env: | |
| DEPENDENCIES: ${{ matrix.dependencies}} | |
| - name: Install Dependencies | |
| run: composer update ${DEPENDENCIES} | |
| env: | |
| DEPENDENCIES: ${{ matrix.dependencies}} | |
| - name: Setup MySQL | |
| run: | | |
| mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "SELECT @@VERSION" | |
| mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "CREATE DATABASE dbunit;" | |
| - name: Run Tests | |
| run: vendor/bin/phpunit | |
| psalm: | |
| name: Psalm | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.3 | |
| coverage: none | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-psalm-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-psalm-composer- | |
| - name: Install Dependencies | |
| run: composer update | |
| - name: Run psalm | |
| run: vendor/bin/psalm --no-cache --output-format=github | |
| coverage: | |
| runs-on: ubuntu-latest | |
| name: Code Coverage | |
| services: | |
| mysql: | |
| image: mysql:5.7 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| ports: | |
| - 3306:3306 | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.2 | |
| coverage: pcov | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-coverage-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-coverage-composer- | |
| - name: Install Dependencies | |
| run: composer update | |
| - name: Setup MySQL | |
| run: | | |
| mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "SELECT @@VERSION" | |
| mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "CREATE DATABASE dbunit;" | |
| - name: Code coverage | |
| run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml | |
| - name: Upload coverage results to Coveralls | |
| env: | |
| COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| composer global require php-coveralls/php-coveralls | |
| php-coveralls --coverage_clover=build/logs/clover.xml -v |