diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5ee1c1e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,59 @@ +# CI pipeline for pull requests targeting master. +# +# Package-level steps (install, typecheck, test, build) require the monorepo +# scaffold (root package.json, pnpm-lock.yaml, turbo tasks) which lands via +# feat/monorepo-scaffold. Until that PR merges and this branch is rebased, +# those steps are expected to fail here; everything up to and including +# pnpm setup runs green. +name: CI + +on: + pull_request: + branches: [master] + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + ci: + name: Typecheck, test, build + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Enable pnpm via corepack + run: corepack enable + + - name: Resolve pnpm store path + id: pnpm-store + run: echo "dir=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" + + - name: Cache pnpm store + uses: actions/cache@v4 + with: + path: ${{ steps.pnpm-store.outputs.dir }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm turbo run typecheck + + - name: Unit tests (domain & extraction packages) + run: pnpm turbo run test + + - name: Build + run: pnpm turbo run build