magallanes/.github/workflows/tests.yml

48 lines
1.1 KiB
YAML
Raw Normal View History

2022-04-10 06:20:03 +02:00
name: PHPUnit
on:
push:
branches:
- master
- galactica
pull_request:
release:
types:
- created
jobs:
unit_tests:
name: Unit tests
2022-04-10 06:20:03 +02:00
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: 8.0
coveralls: true
- php: 8.1
coveralls: false
2022-04-10 06:20:03 +02:00
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: xdebug
2022-04-10 06:20:03 +02:00
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Composer install
run: composer install --ignore-platform-reqs --no-scripts
2022-04-10 06:20:03 +02:00
- name: Run tests
env:
XDEBUG_MODE: coverage
2022-04-11 01:00:47 +02:00
run: |
2022-04-11 00:53:25 +02:00
mkdir .logs
./vendor/bin/phpunit --coverage-clover build/logs/coverage.xml
2022-04-10 06:20:03 +02:00
- name: Run Coveralls
if: ${{ matrix.coveralls }}
2022-04-10 06:20:03 +02:00
env:
2022-04-10 06:41:27 +02:00
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-04-10 06:20:03 +02:00
run: ./vendor/bin/php-coveralls -v --coverage_clover build/logs/coverage.xml