Unit Tests #10
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: | |
pull_request: | |
branches: | |
- master | |
paths-ignore: | |
- 'docs/**' | |
workflow_call: | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_callinputs | |
workflow_dispatch: | |
inputs: | |
composer-options: | |
description: "Composer options for ramsey/composer-install GitHub Action" | |
required: false | |
default: "--prefer-dist --no-dev --no-scripts" | |
type: string | |
jobs: | |
lint_files: | |
uses: llaville/.github/.github/workflows/mega-linter.yml@master | |
with: | |
repository: ${{ github.repository }} | |
composer-options: ${{ inputs.composer-options }} | |
unit_tests: | |
needs: lint_files | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
php: 7.4 | |
continue-on-error: false | |
- os: ubuntu-20.04 | |
php: 8.0 | |
continue-on-error: false | |
- os: ubuntu-22.04 | |
php: 8.1 | |
continue-on-error: false | |
- os: ubuntu-22.04 | |
php: 8.2 | |
continue-on-error: false | |
- os: ubuntu-22.04 | |
php: 8.3 | |
continue-on-error: false | |
name: Unit Tests | |
steps: | |
- # https://github.com/actions/checkout | |
name: Checkout | |
uses: actions/checkout@v4 | |
- # https://github.com/shivammathur/setup-php | |
name: Setup PHP runtime | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: phpunit:10.5 | |
- # https://github.com/ramsey/composer-install | |
name: Install Composer dependencies | |
uses: ramsey/composer-install@v3 | |
with: | |
dependency-versions: "highest" | |
composer-options: ${{ inputs.composer-options }} | |
- # https://github.com/sebastianbergmann/phpunit/tree/10.5 | |
name: Unit tests with PHPUnit 10 | |
if: matrix.php >= '8.1' | |
run: phpunit --do-not-cache-result --no-progress | |
continue-on-error: ${{ matrix.continue-on-error }} |