Merge pull request #9 from cooperaj/modernisation-efforts #61
This file contains 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: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-versions: [ '8.2', '8.3' ] | |
phpunit-versions: ['11.0'] | |
include: | |
- php-versions: '8.1' | |
phpunit-versions: '10.0' | |
steps: | |
- name: Setup PHP with PECL extension | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
tools: composer,phive | |
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@v2 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-php- | |
- name: Install dependencies | |
if: steps.composer-cache.outputs.cache-hit != 'true' | |
run: composer install --prefer-dist --no-progress | |
- name: Install tools | |
run: phive --no-progress install --trust-gpg-keys 4AA394086372C20A,12CE0F1D262429A5 phpunit@^${{ matrix.phpunit-versions }} psalm | |
- name: Run test suite | |
run: tools/phpunit --coverage-clover build/coverage.xml | |
- 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 }} |