Merge pull request #13 #63
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: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
jobs: | |
test: | |
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
name: PHP ${{ matrix.php-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: ['7.2', '7.3', '7.4', '8.0', '8.1'] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
tools: composer:v2 | |
coverage: pcov | |
- name: Setup Composer | |
id: setup-composer | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Setup cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.setup-composer.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock', '**/composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: composer update -n --prefer-dist --no-progress | |
- name: Run tests | |
run: vendor/bin/phpunit | |
- name: Send code coverage | |
if: ${{ !startsWith(matrix.php-version, '7.2') && success() }} | |
continue-on-error: true | |
uses: codacy/codacy-coverage-reporter-action@v1 | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: build/log/clover.xml |