Skip to content

Unit Tests

Unit Tests #212

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 }}
php-version: "8.1"
unit_tests:
needs: lint_files
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
-
os: ubuntu-20.04
php: 8.1
extensions: amqp,apcu,ast,bcmath,bz2,calendar,core,ctype,curl,date,dom,enchant,exif,fileinfo,filter,ftp,gd,gettext,gmp,hash,iconv,igbinary,imagick,imap,intl,json,ldap,libxml,lzf,mbstring,memcache,memcached,mongodb,msgpack,mysqli,oauth,oci8,opcache,openssl,opentelemetry,pcntl,pcre,pdo,pgsql,phar,posix,raphf,pecl_http,readline,redis,reflection,session,shmop,simplexml,sockets,solr,spl,sqlite3,ssh2-beta,standard,sysvmsg,sysvsem,sysvshm,tokenizer,uuid,xdebug,xhprof,xml,xmldiff,xmlreader,xmlwriter,xpass,xsl,yac,zip,zlib
tools: phpunit:10.5
-
os: ubuntu-22.04
php: 8.2
extensions: amqp,apcu,ast,bcmath,bz2,calendar,core,ctype,curl,date,dom,enchant,exif,fileinfo,filter,ftp,gd,gettext,gmp,hash,iconv,igbinary,imagick,imap,intl,json,ldap,libxml,lzf,mbstring,memcache,memcached,mongodb,msgpack,mysqli,oauth,oci8,opcache,openssl,opentelemetry,pcntl,pcre,pdo,pgsql,phar,posix,random,raphf,pecl_http,readline,redis,reflection,session,shmop,simplexml,sockets,solr,spl,sqlite3,ssh2-beta,standard,sysvmsg,sysvsem,sysvshm,tokenizer,uuid,xdebug,xhprof,xml,xmldiff,xmlreader,xmlwriter,xpass,xsl,yac,zip,zlib
tools: phpunit:10.5
continue-on-error: false
-
os: ubuntu-22.04
php: 8.3
extensions: amqp,apcu,ast,bcmath,bz2,calendar,core,ctype,curl,date,dom,enchant,exif,fileinfo,filter,ftp,gd,gettext,gmp,hash,iconv,igbinary,imagick,imap,intl,json,ldap,libxml,lzf,mbstring,memcache,memcached,mongodb,msgpack,mysqli,oauth,oci8,opcache,openssl,pcntl,pcre,pdo,pgsql,phar,posix,random,raphf,pecl_http,readline,redis,reflection,session,shmop,simplexml,sockets,solr,spl,sqlite3,ssh2-beta,standard,sysvmsg,sysvsem,sysvshm,tokenizer,uuid,xdebug,xhprof,xml,xmldiff,xmlreader,xmlwriter,xpass,xsl,yac,zip,zlib
tools: phpunit:10.5
continue-on-error: false
-
os: ubuntu-22.04
php: 8.4
extensions: amqp,apcu,ast,bcmath,bz2,calendar,core,ctype,curl,date,dom,enchant,exif,fileinfo,filter,ftp,gd,gettext,gmp,hash,iconv,igbinary,imagick,imap,intl,json,ldap,libxml,lzf,mbstring,memcache,memcached,mongodb,msgpack,mysqli,oauth,oci8,opcache,openssl,pcntl,pcre,pdo,pgsql,phar,posix,random,raphf,pecl_http,readline,redis,reflection,session,shmop,simplexml,sockets,solr,spl,sqlite3,ssh2-beta,standard,sysvmsg,sysvsem,sysvshm,tokenizer,uuid,xdebug,xhprof,xml,xmldiff,xmlreader,xmlwriter,xpass,xsl,yac,zip,zlib
tools: phpunit:10.5
continue-on-error: true
name: Test DB References
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
-
name: Setup Libraries
run: |
sudo apt-get update
sudo apt-fast install libcurl4-openssl-dev -y
sudo apt-fast install libssh2-1-dev -y
sudo apt-fast install librdkafka-dev -y
- # https://github.com/shivammathur/cache-extensions
name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
key: cache-v6
- # https://github.com/actions/cache
name: Cache extensions
uses: actions/cache@v4
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- # https://github.com/shivammathur/setup-php
name: Setup PHP runtime
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
tools: ${{ matrix.tools }}
- # https://github.com/ramsey/composer-install
name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: "highest"
composer-options: "--prefer-dist --no-scripts"
-
name: Build Database
run: |
bin/compatinfo-db db:create --ansi
bin/compatinfo-db db:init --ansi
-
name: Check Database
run: |
bin/compatinfo-db diagnose --ansi
bin/compatinfo-db db:list --ansi
- # https://github.com/sebastianbergmann/phpunit/tree/10.5
name: Unit tests with PHPUnit 10
run: phpunit --testdox --do-not-cache-result --no-progress
continue-on-error: ${{ matrix.continue-on-error }}