Create basic array/object functionality #1
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: unit-tests | ||
on: | ||
pull_request: | ||
push: | ||
branches: [ main ] | ||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: | ||
- '8.2' | ||
- '8.3' | ||
minimum_versions: [false] | ||
coverage: ['none'] | ||
include: | ||
- description: 'Minimum version' | ||
php: '8.2' | ||
minimum_versions: true | ||
- description: 'Code coverage' | ||
php: '8.2' | ||
coverage: 'pcov' | ||
name: PHP ${{ matrix.php }} ${{ matrix.description }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Cache composer | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-vendor-${{ hashFiles('**/composer.lock') | ||
Check failure on line 36 in .github/workflows/unit-tests.yaml GitHub Actions / unit-testsInvalid workflow file
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: ${{ matrix.coverage }} | ||
- name: Install dependencies | ||
run: composer install | ||
if: matrix.minimum_versions == false | ||
- name: Install dependencies (minimum versions) | ||
run: composer update --no-interaction --prefer-lowest | ||
if: matrix.minimum_versions == true | ||
- name: Run tests | ||
run: vendor/bin/phpunit --no-coverage | ||
if: matrix.coverage == 'none' | ||
- name: Run tests with code coverage | ||
run: vendor/bin/phpunit | ||
if: matrix.coverage == 'pcov' | ||
- name: Upload coverage reports | ||
uses: codecov/codecov-action@v4-beta | ||
if: matrix.coverage == 'pcov' | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
file: build/coverage.xml | ||
fail_ci_if_error: true |