Merge pull request #243 from toby-griffiths/patch-1 #136
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: PHP Tests | |
on: | |
push: | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
env: | |
XDEBUG_MODE: coverage | |
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
strategy: | |
matrix: | |
php: [ 7.3, 7.4, 8.0, 8.2 ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-php-${{ matrix.php }}- | |
- name: Install dependencies | |
uses: php-actions/composer@v6 | |
with: | |
php_version: ${{ matrix.php }} | |
version: 2.x | |
- name: Run tests | |
uses: php-actions/composer@v6 | |
with: | |
php_version: ${{ matrix.php }} | |
php_extensions: xdebug | |
version: 2.x | |
command: run-script test | |
- name: Create build directory necessary for coveralls # see https://github.com/php-coveralls/php-coveralls/issues/251 | |
run: mkdir -p build/logs | |
shell: bash | |
- name: workaround for failing build | |
run: git config --global --add safe.directory /app | |
shell: bash | |
- name: Upload coverage | |
uses: php-actions/composer@v6 | |
with: | |
php_version: ${{ matrix.php }} | |
version: 2.x | |
command: run-script upload-coverage | |