chore: improve test suite #122
Workflow file for this run
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: "Continuous Integration" | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
checks: | |
name: Quality Checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout Code" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "xdebug" | |
php-version: "8.3" | |
ini-values: memory_limit=-1 | |
tools: composer:v2 | |
- name: "Cache Dependencies" | |
uses: "actions/cache@v4" | |
with: | |
path: | | |
$HOME/.composer/cache | |
key: "composer-8.3-lock" | |
restore-keys: "composer-8.3-lock" | |
- name: "Install Dependencies" | |
run: "composer install --ansi --no-interaction --no-progress" | |
- name: "Check code style" | |
run: composer fmt:check | |
- name: "Check Types" | |
run: composer psalm:gh | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
needs: ["checks"] | |
strategy: | |
matrix: | |
php-version: ["8.3", "8.4"] | |
deps: ["lock", "highest", "lowest"] | |
steps: | |
- name: "Checkout Code" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "xdebug" | |
php-version: ${{ matrix.php-version }} | |
ini-values: memory_limit=-1 | |
tools: composer:v2 | |
- name: "Cache Dependencies" | |
uses: "actions/cache@v4" | |
with: | |
path: | | |
$HOME/.composer/cache | |
key: "composer-${{ matrix.version }}-${{ matrix.deps }}" | |
restore-keys: "composer-${{ matrix.version }}-${{ matrix.deps }}" | |
- name: "Install Dependencies" | |
if: ${{ matrix.deps == 'lock'}} | |
run: "composer install ${{ matrix.php-version == '8.4' && '--ignore-platform-reqs' }} --ansi --no-interaction --no-progress --no-suggest" | |
- name: "Install Highest Dependencies" | |
if: ${{ matrix.deps == 'highest'}} | |
run: "composer update ${{ matrix.php-version == '8.4' && '--ignore-platform-reqs' }} --ansi --no-interaction --no-progress --no-suggest" | |
- name: "Install Lowest Dependencies" | |
if: ${{ matrix.deps == 'lowest'}} | |
run: "composer update ${{ matrix.php-version == '8.4' && '--ignore-platform-reqs' }} --prefer-lowest --ansi --no-interaction --no-progress --no-suggest" | |
- name: "Run Test Suite" | |
run: composer test | |
- name: "Upload Coverage Report" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "coverage-report-${{ matrix.version }}-${{ matrix.deps }}" | |
path: .dev/coverage |