separate Unit Tests depending on system in tests workflow #164
Workflow file for this run
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: Tests | ||
on: ['push', 'pull_request'] | ||
jobs: | ||
ci: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
php: ['8.1', '8.2', '8.3', '8.4'] | ||
pest: ['2.0', '3.0'] | ||
dependency-version: [prefer-lowest, prefer-stable] | ||
exclude: | ||
- php: '8.1' | ||
pest: '3.0' | ||
name: PHP ${{ matrix.php }} - PEST ^${{ matrix.pest }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v2 | ||
coverage: xdebug | ||
- name: Install PHP dependencies | ||
run: | | ||
composer require "pestphp/pest:^${{ matrix.pest }}" --no-interaction --no-update | ||
composer update --${{ matrix.dependency-version }} --no-interaction --no-progress --ansi | ||
- name: Unit Tests (not macos) | ||
if: matrix.os !== 'macos-latest' | ||
Check failure on line 37 in .github/workflows/tests.yml
|
||
run: composer test:unit -- --coverage-clover ./coverage.xml | ||
- name: Unit Tests (macos) | ||
if: matrix.os == 'macos-latest' | ||
run: composer test:unit | ||
- name: Upload coverage reports to Codecov | ||
if: ${{matrix.os == 'ubuntu-latest' && matrix.php == '8.1'}} | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
verbose: true |