Add the AI usage badge and pinned agent-badge tooling #62
This file contains hidden or 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: | |
| push: | |
| branches: | |
| - master | |
| - develop | |
| - ci | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| name: Lint | PHP ${{ matrix.php-version }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: | |
| - "8.1" | |
| - "8.2" | |
| - "8.3" | |
| - "8.4" | |
| - "8.5" | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| coverage: none | |
| php-version: ${{ matrix.php-version }} | |
| tools: composer:v2 | |
| - name: Validate Composer files | |
| run: composer validate --strict | |
| - name: Find Composer cache directory | |
| id: composer-cache | |
| run: echo "path=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
| - name: Cache Composer packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.path }} | |
| key: composer-${{ runner.os }}-${{ runner.arch }}-php-${{ matrix.php-version }}-${{ hashFiles('composer.json', 'composer.lock') }} | |
| restore-keys: | | |
| composer-${{ runner.os }}-${{ runner.arch }}-php-${{ matrix.php-version }}- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-interaction --no-progress | |
| - name: Run PHP_CodeSniffer | |
| run: composer phpcs | |
| - name: Run PHPStan | |
| run: composer phpstan -- analyze | |
| test: | |
| runs-on: ubuntu-latest | |
| name: Test | PHP ${{ matrix.php-version }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: | |
| - "8.1" | |
| - "8.2" | |
| - "8.3" | |
| - "8.4" | |
| - "8.5" | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| coverage: none | |
| php-version: ${{ matrix.php-version }} | |
| tools: composer:v2 | |
| - name: Find Composer cache directory | |
| id: composer-cache | |
| run: echo "path=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
| - name: Cache Composer packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.path }} | |
| key: composer-${{ runner.os }}-${{ runner.arch }}-php-${{ matrix.php-version }}-${{ hashFiles('composer.json', 'composer.lock') }} | |
| restore-keys: | | |
| composer-${{ runner.os }}-${{ runner.arch }}-php-${{ matrix.php-version }}- | |
| - name: Install dependencies | |
| run: composer update --prefer-dist --no-interaction --no-progress | |
| - name: Run test suite | |
| run: composer phpunit -- --no-coverage | |
| phpstan-compatibility: | |
| runs-on: ubuntu-latest | |
| name: Compatibility | PHPStan ${{ matrix.phpstan-version }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - phpstan-version: "2.0.4" | |
| phpstan-constraint: "2.0.4" | |
| phpstan-phpunit-constraint: "2.0.6" | |
| phpstan-strict-rules-constraint: "2.0.4" | |
| php-parser-constraint: "^5.8" | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| coverage: none | |
| php-version: "8.1" | |
| tools: composer:v2 | |
| - name: Find Composer cache directory | |
| id: composer-cache | |
| run: echo "path=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
| - name: Cache Composer packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.path }} | |
| key: composer-${{ runner.os }}-${{ runner.arch }}-php-8.1-phpstan-${{ matrix.phpstan-version }}-${{ hashFiles('composer.json', 'composer.lock') }} | |
| restore-keys: | | |
| composer-${{ runner.os }}-${{ runner.arch }}-php-8.1-phpstan-${{ matrix.phpstan-version }}- | |
| - name: Install compatibility dependencies | |
| run: composer update --prefer-dist --no-interaction --no-progress --with-all-dependencies phpstan/phpstan:${{ matrix.phpstan-constraint }} phpstan/phpstan-phpunit:${{ matrix.phpstan-phpunit-constraint }} phpstan/phpstan-strict-rules:${{ matrix.phpstan-strict-rules-constraint }} nikic/php-parser:${{ matrix.php-parser-constraint }} | |
| - name: Run test suite | |
| run: composer phpunit -- --no-coverage | |
| phpunit-compatibility: | |
| runs-on: ubuntu-latest | |
| name: Compatibility | PHPUnit ${{ matrix.phpunit-version }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - php-version: "8.1" | |
| phpunit-version: "10.5.62" | |
| - php-version: "8.2" | |
| phpunit-version: "11.5.50" | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| coverage: none | |
| php-version: ${{ matrix.php-version }} | |
| tools: composer:v2 | |
| - name: Find Composer cache directory | |
| id: composer-cache | |
| run: echo "path=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
| - name: Cache Composer packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.path }} | |
| key: composer-${{ runner.os }}-${{ runner.arch }}-php-${{ matrix.php-version }}-phpunit-${{ matrix.phpunit-version }}-${{ hashFiles('composer.json', 'composer.lock') }} | |
| restore-keys: | | |
| composer-${{ runner.os }}-${{ runner.arch }}-php-${{ matrix.php-version }}-phpunit-${{ matrix.phpunit-version }}- | |
| - name: Install compatibility dependencies | |
| run: composer update --prefer-dist --no-interaction --no-progress --with-all-dependencies phpunit/phpunit:${{ matrix.phpunit-version }} | |
| - name: Run test suite | |
| run: composer phpunit -- --no-coverage | |
| coverage: | |
| runs-on: ubuntu-latest | |
| name: Coverage | PHP 8.5 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| coverage: pcov | |
| php-version: "8.5" | |
| tools: composer:v2 | |
| - name: Find Composer cache directory | |
| id: composer-cache | |
| run: echo "path=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | |
| - name: Cache Composer packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.path }} | |
| key: composer-${{ runner.os }}-${{ runner.arch }}-php-8.5-${{ hashFiles('composer.json', 'composer.lock') }} | |
| restore-keys: | | |
| composer-${{ runner.os }}-${{ runner.arch }}-php-8.5- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-interaction --no-progress | |
| - name: Run test suite with coverage | |
| run: composer phpunit -- --coverage-text | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-report | |
| path: clover.xml | |
| if-no-files-found: error | |
| nix: | |
| runs-on: ubuntu-latest | |
| name: Nix flake | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v31 | |
| - name: Cache Nix store | |
| uses: nix-community/cache-nix-action@v7 | |
| with: | |
| primary-key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} | |
| restore-prefixes-first-match: | | |
| nix-${{ runner.os }}-${{ runner.arch }}- | |
| gc-max-store-size-linux: 1G | |
| - name: Check flake | |
| run: nix flake check -L |