magallanes/.github/workflows/tests.yml
Ismael Ambrosi 8514097ce1
Fix PHP version used by testing workflow
The fix is to use the action `shivammathur/setup-php@v2` to setup the proper PHP version in the test runner, replacing `php-actions/composer` which only ensured using the desired PHP version while installing the project dependencies.
2022-04-18 00:49:16 -03:00

48 lines
1.1 KiB
YAML

name: PHPUnit
on:
push:
branches:
- master
- galactica
pull_request:
release:
types:
- created
jobs:
unit_tests:
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: 8.0
coveralls: true
- php: 8.1
coveralls: false
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: xdebug
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Composer install
run: composer install --ignore-platform-reqs --no-scripts
- 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