Initial Commit #6
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: | |
| permissions: | |
| contents: read | |
| env: | |
| CI: 'true' | |
| jobs: | |
| install: | |
| name: Install (pnpm fetch/offline) | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Enable pnpm via Corepack | |
| run: corepack enable && corepack prepare pnpm@${{ env.PNPM_VERSION }} --activate | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| - name: pnpm fetch | |
| run: pnpm fetch | |
| - name: pnpm install --offline | |
| run: pnpm install --offline --frozen-lockfile | |
| - name: Restore turbo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: turbo-${{ runner.os }}-${{ hashFiles('**/*.[tj]s', '**/*.[tj]sx', 'pnpm-lock.yaml') }} | |
| restore-keys: | | |
| turbo-${{ runner.os }}- | |
| quality: | |
| name: Lint / Typecheck / Knip | |
| needs: install | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Enable pnpm via Corepack | |
| run: corepack enable && corepack prepare pnpm@${{ env.PNPM_VERSION }} --activate | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| - name: pnpm install --offline | |
| run: pnpm install --offline --frozen-lockfile | |
| - name: Lint & Format check (biome) | |
| run: pnpm run format-and-lint | |
| - name: Unused deps check (knip) | |
| run: pnpm run check-deps | |
| test: | |
| name: Test (vitest + coverage) | |
| needs: install | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Enable pnpm via Corepack | |
| run: corepack enable && corepack prepare pnpm@${{ env.PNPM_VERSION }} --activate | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: pnpm install --offline | |
| run: pnpm install --offline --frozen-lockfile | |
| - name: Prepare test env | |
| run: pnpm run reset | |
| - name: Run tests | |
| run: pnpm test | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage/lcov.info | |
| build: | |
| name: Build (turbo) | |
| needs: [quality, test] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Enable pnpm via Corepack | |
| run: corepack enable && corepack prepare pnpm@${{ env.PNPM_VERSION }} --activate | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| - name: pnpm install --offline | |
| run: pnpm install --offline --frozen-lockfile | |
| - name: Restore turbo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: turbo-${{ runner.os }}-${{ hashFiles('**/*.[tj]s', '**/*.[tj]sx', 'pnpm-lock.yaml') }} | |
| restore-keys: | | |
| turbo-${{ runner.os }}- | |
| - name: Build | |
| run: pnpm run build |