Merge pull request #394 from KumbiaPHP/joanhey-patch-2 #108
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: PHPUnit | |
on: | |
push: | |
branches: | |
- dev | |
- master | |
paths: | |
- 'default/app/**.php' | |
- 'core/**.php' | |
- 'core/tests/**.php' | |
- 'default/app/tests/**.php' | |
- composer.json | |
- core/phpunit.xml.dist | |
- default/app/phpunit.xml.dist | |
- .github/workflows/phpunit.yml | |
pull_request: | |
branches: | |
- dev | |
- master | |
paths: | |
- 'default/app/**.php' | |
- 'core/**.php' | |
- 'core/tests/**.php' | |
- 'default/app/tests/**.php' | |
- composer.json | |
- core/phpunit.xml.dist | |
- default/app/phpunit.xml.dist | |
- .github/workflows/phpunit.yml | |
jobs: | |
tests: | |
name: PHP ${{ matrix.php-versions }} | |
runs-on: ubuntu-20.04 | |
if: "!contains(github.event.head_commit.message, '[ci skip]')" | |
strategy: | |
fail-fast: false | |
matrix: | |
php-versions: ['8.0', '8.1', '8.2', '8.3'] | |
phpunit-versions: ['latest'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP, with composer | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
tools: composer | |
extensions: gd, sqlite3 | |
coverage: none | |
env: | |
update: true | |
- name: Get composer cache directory | |
id: composercache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composercache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: composer install --prefer-dist | |
- name: Test core with PHPUnit | |
run: script -e -c "vendor/bin/phpunit --color=always --configuration core/phpunit.xml.dist" | |
env: | |
TERM: xterm-256color | |
- name: Test app with PHPUnit | |
run: script -e -c "vendor/bin/phpunit --color=always --configuration default/app/phpunit.xml.dist" | |
env: | |
TERM: xterm-256color |