Can't run composer like I was expecting. #75
Workflow file for this run
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: Build | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test-lint-and-analyse: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php-versions: [ '8.2', '8.3', '8.4' ] | |
| phpunit-versions: ['11.0'] | |
| psalm-versions: ['6.0'] | |
| dependency-versions: [''] | |
| include: | |
| - php-versions: '8.1' | |
| phpunit-versions: '10.0' | |
| psalm-versions: '5.0' | |
| dependency-versions: '' | |
| - php-versions: '8.1' | |
| phpunit-versions: '10.0' | |
| psalm-versions: '5.0' | |
| dependency-versions: '--prefer-lowest' | |
| steps: | |
| - name: Setup PHP with PECL extension | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| tools: composer,phive,cs2pr | |
| coverage: xdebug | |
| - 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" | |
| - uses: actions/checkout@v2 | |
| - name: Validate composer.json and composer.lock | |
| run: composer validate | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.json') }}-${{ matrix.dependency-versions }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| if: steps.composer-cache.outputs.cache-hit != 'true' | |
| run: composer update --prefer-dist --no-progress ${{ matrix.dependency-versions }} | |
| - name: Install tools | |
| run: phive --no-progress install --trust-gpg-keys 4AA394086372C20A,12CE0F1D262429A5,97B02DD8E5071466 phpunit@^${{ matrix.phpunit-versions }} psalm@^${{ matrix.psalm-versions }} phpcs | |
| - name: Run test suite | |
| run: tools/phpunit --coverage-clover build/coverage.xml | |
| - name: Run linting | |
| run: tools/phpcs -q --standard=PSR12 --report=checkstyle src/ | cs2pr | |
| - name: Run static analysis | |
| run: tools/psalm --output-format=github --shepherd | |
| - uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./build/coverage.xml | |
| flags: unit,integration | |
| fail_ci_if_error: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| if: matrix.php-versions == '8.4' |