Ensure PHPUnit tests are run when third party JSON files are changed.… #24
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 Unit Testing | |
on: | |
push: | |
branches: | |
- main | |
# Only run if PHP-related files changed. | |
paths: | |
- '.github/workflows/php-test.yml' | |
- 'data/*.json' | |
- '**.php' | |
- 'phpunit.xml.dist' | |
- 'composer.json' | |
- 'composer.lock' | |
pull_request: | |
branches: | |
- main | |
# Only run if PHP-related files changed. | |
paths: | |
- '.github/workflows/php-test.yml' | |
- 'data/*.json' | |
- '**.php' | |
- 'phpunit.xml.dist' | |
- 'composer.json' | |
- 'composer.lock' | |
types: | |
- opened | |
- reopened | |
- synchronize | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
jobs: | |
php-test: | |
name: PHP | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
- name: Validate Composer configuration | |
run: composer validate | |
- name: Install Composer dependencies | |
run: composer update | |
- name: PHPUnit Test | |
run: composer test |