diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..95ac022 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + pull_request: + push: + branches: [master] + workflow_dispatch: + +# Least privilege: the job only needs to read the repo. +permissions: + contents: read + +# Cancel a PR's in-progress run when a new commit is pushed to the same ref. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + verify: + name: verify + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: npm + + - name: Install dependencies + run: npm ci + + # Ordered cheap → expensive for fast feedback. These mirror the local gates in CLAUDE.md. + - name: Lint + run: npm run lint + + - name: Typecheck + run: npm run typecheck + + - name: Test + run: npm run test + + - name: Build + run: npm run build + + # Fail loudly if the manifest copy step didn't produce a loadable extension. + - name: Verify build output + run: test -f dist/manifest.json