Skip to content

Commit

Permalink
Simplify workflow by leveraging build matrix
Browse files Browse the repository at this point in the history
This allows to reuse the workflow syntax for a job, tweaking small parts via configuration.
  • Loading branch information
iambrosi committed Apr 15, 2022
1 parent bb2ee8d commit d32fa10
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions .github/workflows/tests.yml
Expand Up @@ -11,9 +11,16 @@ on:
- created

jobs:
unit_tests_80:
name: Unit tests with PHP 8.0
unit_tests:
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: 8.0
coveralls: true
- php: 8.1
coveralls: false
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -25,36 +32,15 @@ jobs:
command: install
args: --ignore-platform-reqs --no-scripts
version: 2
php_version: 8.0
php_version: ${{ matrix.php }}
- name: Run tests
env:
XDEBUG_MODE: coverage
run: |
mkdir .logs
./vendor/bin/phpunit --coverage-clover build/logs/coverage.xml
- name: Run Coveralls
if: ${{ matrix.coveralls }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./vendor/bin/php-coveralls -v --coverage_clover build/logs/coverage.xml

unit_tests_81:
name: Unit tests with PHP 8.1
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Composer install
uses: php-actions/composer@v5
with:
command: install
args: --ignore-platform-reqs --no-scripts
version: 2
php_version: 8.1
- name: Run tests
env:
XDEBUG_MODE: coverage
run: |
mkdir .logs
./vendor/bin/phpunit --coverage-clover build/logs/coverage.xml

0 comments on commit d32fa10

Please sign in to comment.