Merge pull request #184 from Automattic/standardize/configs-and-ci #3
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: Unit Tests | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - trunk | |
| paths: | |
| - '**.php' | |
| - 'composer.json' | |
| - 'phpunit.xml.dist' | |
| - '.github/workflows/unit.yml' | |
| pull_request: | |
| paths: | |
| - '**.php' | |
| - 'composer.json' | |
| - 'phpunit.xml.dist' | |
| - '.github/workflows/unit.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| unit-tests: | |
| name: PHP ${{ matrix.php }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: | |
| - '7.4' | |
| - '8.1' | |
| - '8.2' | |
| - '8.3' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Setup PHP ${{ matrix.php }} | |
| uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: none | |
| - name: Install Composer dependencies | |
| uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # 3.1.1 | |
| - name: Setup problem matchers for PHP | |
| run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
| - name: Setup problem matchers for PHPUnit | |
| run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
| - name: Run unit tests | |
| run: composer test:unit |