ci(ci): Update action references and enhance CI configurations #840
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: tests | |
| on: | |
| workflow_dispatch: | |
| push: | |
| pull_request: | |
| env: | |
| COMPOSER_NO_SECURITY_BLOCKING: 1 | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, macos-latest, ubuntu-latest] | |
| php: [8.1, 8.5] | |
| dependency-version: [prefer-stable] | |
| name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: xdebug | |
| # extensions: amqp,apcu,brotli,igbinary,intl,mbstring,memcached,redis,relay,zstd,:php-psr | |
| env: | |
| COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # - name: Get composer cache directory | |
| # id: composer-cache | |
| # run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| # | |
| # - name: Cache composer dependencies | |
| # uses: actions/cache@v4 | |
| # with: | |
| # path: ${{ steps.composer-cache.outputs.dir }} | |
| # # Use composer.json for key, if composer.lock is not committed. | |
| # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| # # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| # restore-keys: ${{ runner.os }}-composer- | |
| - name: Install dependencies | |
| run: composer update --${{ matrix.dependency-version }} --no-interaction --ansi -v | |
| - name: Execute tests | |
| run: composer test:coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./.build/phpunit/clover.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
| fail_ci_if_error: true # optional (default = false) | |
| verbose: true # optional (default = false) |