Skip to content

Unit Tests

Unit Tests #98

Workflow file for this run

---
name: Unit Tests
on:
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
workflow_call:
workflow_dispatch:
jobs:
lint_files:
uses: llaville/.github/.github/workflows/mega-linter.yml@master
with:
repository: ${{ github.repository }}
unit_tests:
needs: lint_files
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
php: 8.1
continue-on-error: false
- os: ubuntu-22.04
php: 8.2
continue-on-error: false
- os: ubuntu-22.04
php: 8.3
continue-on-error: false
- os: ubuntu-22.04
php: 8.4
continue-on-error: false
name: Unit Tests
env:
APP_ENV: dev # see explains at https://github.com/llaville/php-compatinfo-db/issues/101
DATABASE_URL: "sqlite:///%kernel.cache_dir%/compatinfo-db.sqlite"
steps:
- # https://github.com/actions/checkout
name: Checkout
uses: actions/checkout@v4
- # https://github.com/shivammathur/setup-php
name: Setup PHP runtime
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json,pcre,pdo,phar,spl,mbstring,sqlite
- # https://github.com/ramsey/composer-install
name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: "highest"
composer-options: "--prefer-dist"
- # https://github.com/llaville/php-compatinfo-db
name: Build Database
run: |
bin/phpcompatinfo db:new --ansi
- # https://github.com/sebastianbergmann/phpunit/tree/10.5
name: Unit tests with PHPUnit 10
run: vendor/bin/phpunit --group features,large,reference,regression,default --do-not-cache-result --no-progress
continue-on-error: ${{ matrix.continue-on-error }}