|
| 1 | +name: ci |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ci-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + php: |
| 18 | + name: php ${{ matrix.php }} · ${{ matrix.os }} |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + os: [ubuntu-latest, macos-latest] |
| 23 | + php: ["8.3", "8.4"] |
| 24 | + runs-on: ${{ matrix.os }} |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v6 |
| 27 | + |
| 28 | + - name: Skip if bootstrap not run |
| 29 | + id: precheck |
| 30 | + run: | |
| 31 | + if [ ! -f composer.json ]; then |
| 32 | + echo "skip=true" >> "$GITHUB_OUTPUT" |
| 33 | + echo "::notice::composer.json not present yet — see INITIALIZE.md" |
| 34 | + else |
| 35 | + echo "skip=false" >> "$GITHUB_OUTPUT" |
| 36 | + fi |
| 37 | +
|
| 38 | + - name: Setup PHP |
| 39 | + if: steps.precheck.outputs.skip == 'false' |
| 40 | + uses: shivammathur/setup-php@v2 |
| 41 | + with: |
| 42 | + php-version: ${{ matrix.php }} |
| 43 | + extensions: mbstring, xml, ctype, json, pdo, sqlite, pdo_sqlite, intl |
| 44 | + coverage: none |
| 45 | + |
| 46 | + - name: Install |
| 47 | + if: steps.precheck.outputs.skip == 'false' |
| 48 | + run: composer install --prefer-dist --no-progress --no-interaction |
| 49 | + |
| 50 | + - name: Pint (lint) |
| 51 | + if: steps.precheck.outputs.skip == 'false' |
| 52 | + run: ./vendor/bin/pint --test |
| 53 | + |
| 54 | + - name: PHPStan (types) |
| 55 | + if: steps.precheck.outputs.skip == 'false' |
| 56 | + run: ./vendor/bin/phpstan analyse --no-progress |
| 57 | + |
| 58 | + - name: Pest (tests) |
| 59 | + if: steps.precheck.outputs.skip == 'false' |
| 60 | + run: ./vendor/bin/pest |
| 61 | + |
| 62 | + node: |
| 63 | + name: node 22 · assets |
| 64 | + runs-on: ubuntu-latest |
| 65 | + steps: |
| 66 | + - uses: actions/checkout@v6 |
| 67 | + |
| 68 | + - name: Skip if bootstrap not run |
| 69 | + id: precheck |
| 70 | + run: | |
| 71 | + if [ ! -f package.json ]; then |
| 72 | + echo "skip=true" >> "$GITHUB_OUTPUT" |
| 73 | + echo "::notice::package.json not present yet — see INITIALIZE.md" |
| 74 | + else |
| 75 | + echo "skip=false" >> "$GITHUB_OUTPUT" |
| 76 | + fi |
| 77 | +
|
| 78 | + - uses: pnpm/action-setup@v4 |
| 79 | + if: steps.precheck.outputs.skip == 'false' |
| 80 | + with: |
| 81 | + version: 9 |
| 82 | + |
| 83 | + - uses: actions/setup-node@v6 |
| 84 | + if: steps.precheck.outputs.skip == 'false' |
| 85 | + with: |
| 86 | + node-version: "22" |
| 87 | + cache: pnpm |
| 88 | + |
| 89 | + - run: pnpm install --frozen-lockfile |
| 90 | + if: steps.precheck.outputs.skip == 'false' |
| 91 | + |
| 92 | + - run: pnpm lint |
| 93 | + if: steps.precheck.outputs.skip == 'false' |
| 94 | + |
| 95 | + - run: pnpm typecheck |
| 96 | + if: steps.precheck.outputs.skip == 'false' |
| 97 | + |
| 98 | + - run: pnpm test |
| 99 | + if: steps.precheck.outputs.skip == 'false' |
0 commit comments