CI #78
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: "CI" | |
on: | |
pull_request: # Note: By default, a workflow only runs when a pull_request's activity type is opened, synchronize, or reopened | |
branches: | |
- "main" # only PRs to main | |
push: | |
branches: | |
- "main" # merge to main assuming main branch is protected | |
workflow_dispatch: | |
schedule: | |
- cron: "37 13 * * 1" # daily at 13:37 | |
jobs: | |
ci: | |
name: "Install dependencies and run tests" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
php-version: | |
# https://www.php.net/supported-versions.php | |
# https://github.com/shivammathur/setup-php#tada-php-support | |
- "8.2" | |
- "8.3" | |
dependencies: | |
- "lowest" | |
- "highest" | |
os: | |
- "ubuntu-latest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
php-version: "${{ matrix.php-version }}" | |
tools: "composer:v2" # installed by default but now explicit | |
coverage: "none" | |
env: | |
fail-fast: true | |
- name: "Validate composer.json and composer.lock" | |
run: "composer validate --strict --no-interaction --ansi" | |
- name: "Install dependencies with Composer" | |
uses: "ramsey/composer-install@v3" | |
with: | |
dependency-versions: "${{ matrix.dependencies }}" | |
- name: "Run PHPUnit" | |
run: "vendor/bin/phpunit --testdox" |