Isolated tests #3457
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: Isolated tests | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - "docs/**" | |
| - ".github/**" | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| jobs: | |
| get_packages: | |
| name: Get packages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.4 | |
| coverage: none | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Get packages | |
| id: get_json | |
| run: echo "json=$(bin/get-packages)" >> $GITHUB_OUTPUT | |
| - name: Output packages | |
| run: echo "${{ steps.get_json.outputs.json }}" | |
| outputs: | |
| matrix: ${{ steps.get_json.outputs.json }} | |
| phpunit: | |
| runs-on: ${{ matrix.os }} | |
| needs: get_packages | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| package: ${{ fromJson(needs.get_packages.outputs.matrix) }} | |
| php: | |
| - 8.4 | |
| stability: | |
| - prefer-stable | |
| - prefer-lowest | |
| name: "Run tests: ${{ matrix.package.name }} - PHP ${{ matrix.php }} - ${{ matrix.stability }}" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: dom, curl, libxml, mbstring, pcntl, fileinfo, intl | |
| coverage: pcov | |
| - name: Setup Redis | |
| if: ${{ matrix.os != 'windows-latest' && matrix.package.name == 'kv-store' }} | |
| uses: supercharge/[email protected] | |
| - name: Install PHPUnit | |
| run: composer global require phpunit/phpunit:12.4.0 | |
| - name: Setup problem matchers | |
| run: | | |
| echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
| echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
| - name: Install dependencies | |
| run: | | |
| ./bin/build-changed-packages | |
| cd "packages/${{ matrix.package.basename }}" | |
| composer update --${{ matrix.stability }} --prefer-dist --no-interaction | |
| - name: Execute tests | |
| run: phpunit -c "packages/${{ matrix.package.basename }}/phpunit.xml" |