Upgrades, min PHP 7.4 #36
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
# This file lints the code and runs tests. | |
name: CI | |
on: | |
pull_request: | |
push: | |
env: | |
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist" | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: | |
- '8.4' | |
- '8.3' | |
- '8.2' | |
- '8.1' | |
- '8.0' | |
- '7.4' | |
include: | |
- php: '7.4' | |
cs_fixer: true | |
- php: '8.0' | |
phpstan: true | |
name: 'Check with PHP ${{ matrix.php }}' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v31 | |
- name: Set up Nix cache | |
uses: cachix/cachix-action@v16 | |
with: | |
# Use cache from https://github.com/fossar/nix-phps | |
name: fossar | |
- name: Update flake.nix to match the current CI job from matrix | |
run: sed -i 's/matrix.phpPackage = "php";/matrix.phpPackage = builtins.replaceStrings ["."] [""] "php${{ matrix.php }}";/' flake.nix | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: nix-shell --run 'composer install' | |
- name: Check source code syntax | |
run: nix-shell --run 'composer lint' | |
- name: Lint source code | |
if: matrix.cs_fixer | |
run: nix-shell --run 'composer cs' | |
- name: Run unit tests | |
run: nix-shell --run 'composer test' | |
- name: Statically analyze source code | |
if: matrix.phpstan | |
run: nix-shell --run 'composer phpstan' |