From dc2d8f004e596a9529410e0fb623a45b52f4bea3 Mon Sep 17 00:00:00 2001 From: dinesh Date: Tue, 19 May 2026 11:16:53 +0530 Subject: [PATCH] feat: add CI pipeline with lint, typecheck, test, and PR title enforcement --- .github/workflows/ci.yml | 49 ++++++++++++++++++++++++++++++++++ .github/workflows/pr-title.yml | 14 ++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/pr-title.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4f1ba70 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: ["**"] + +jobs: + ci: + name: Typecheck / Lint / Test (Node ${{ matrix.node-version }}) + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18, 20] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm -r run typecheck + + - name: Lint + run: pnpm -r run lint + + - name: Test + run: pnpm -r run test --coverage + + - name: Upload coverage + uses: actions/upload-artifact@v4 + with: + name: coverage-node-${{ matrix.node-version }} + path: "**/coverage" + if-no-files-found: ignore diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 0000000..9833ba4 --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,14 @@ +name: PR Title Check + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + pr-title: + name: Enforce Conventional Commits + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}