Include CodeCov token when uploading coverage #15
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 | |
# Ensure tests pass whatever is the minor PHP version currently supported (see strategy.matrix.php) | |
# crossed with "lowest" setup (install the lowest possible dependency versions allowed by the range) | |
# and with "stable" setup (install the highest possible dependency stable versions allowed by the range) | |
on: | |
push: | |
branches: [ '**' ] | |
pull_request: | |
branches: [ '**' ] | |
jobs: | |
php-tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
env: | |
COMPOSER_NO_INTERACTION: 1 | |
strategy: | |
matrix: | |
php: [ 8.1, 8.2, 8.3, 8.4 ] | |
setup: [ lowest, stable ] | |
name: PHP ${{ matrix.php }} - prefer-${{ matrix.setup }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: none | |
tools: composer:v2 | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.setup }}-${{ hashFiles('composer.json') }} | |
- name: Install dependencies | |
if: steps.composer-cache.outputs.cache-hit != 'true' && matrix.php != '8.4' | |
run: composer update --no-progress --prefer-${{ matrix.setup }} --prefer-dist --no-progress | |
# For now we need to overwrite the PHP version check on the 8.4 beta as paratest has not been releasd for it yet | |
- name: Install dependencies (PHP 8.4 beta) | |
if: steps.composer-cache.outputs.cache-hit != 'true' && matrix.php == '8.4' | |
run: composer update --no-progress --prefer-${{ matrix.setup }} --prefer-dist --no-progress --ignore-platform-req=php | |
- name: Execute Unit Tests | |
run: vendor/bin/paratest | |
- name: Run PHPStan | |
if: matrix.php != '8.4' | |
run: vendor/bin/phpstan |