Added project documentation #23
Workflow file for this run
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: | |
| - main | |
| pull_request: ~ | |
| workflow_dispatch: ~ | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: json | |
| coverage: none | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: lint-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: lint-composer- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist | |
| - name: Run simple-phpunit version check | |
| run: ./vendor/bin/simple-phpunit --version | |
| - name: Run code style check | |
| run: composer cs-fixer -- --dry-run --diff | |
| - name: Run static analysis | |
| run: composer phpstan | |
| tests: | |
| name: Tests (PHP ${{ matrix.php }}) | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| php: | |
| - '8.4' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: json | |
| coverage: none | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ matrix.php }}-composer- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist | |
| - name: Run tests | |
| run: composer test |