Workflow update #103
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: Unit tests | |
on: | |
# Run on PRs and pushes. | |
push: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '**.yml' | |
- '**.json' | |
- '**.xml' | |
- '**.neon' | |
- '**.lock' | |
# Allow manually triggering the workflow. | |
workflow_dispatch: | |
# Cancels all previous workflow runs for the same branch that have not yet completed. | |
concurrency: | |
# The concurrency group contains the workflow name and the branch name. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
tests: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [7.4, 8.0, 8.1, 8.2, 8.3] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: PHP setup | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: xdebug | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v2 | |
with: | |
custom-cache-suffix: $(date -u "+%Y-%m") | |
- name: Run unit tests | |
run: composer test:unit | |
- name: Run coverage generation | |
run: composer test:coverage -q # We don't need an output for coverage, codecov will do that. | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./tests/coverage/clover.xml | |
flags: unittests | |
name: libs-codecov | |
fail_ci_if_error: true |