release #726
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, only on significant changes. | |
push: | |
branches: | |
- develop | |
- main | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
# Prevent multiple unnecessary CI runs on the same branch. | |
# Link: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
tests: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: PHP setup | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
coverage: pcov | |
env: | |
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Install dependencies and handle caching in one go. | |
# @link https://github.com/marketplace/actions/install-composer-dependencies | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v2 | |
with: | |
dependency-versions: highest | |
ignore-cache: "yes" | |
- 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 |