From 0997521670e1d6f7b2f3ce64266c96eac9763f47 Mon Sep 17 00:00:00 2001 From: Aditya <97450298+1234-ad@users.noreply.github.com> Date: Mon, 12 Jan 2026 22:06:54 +0530 Subject: [PATCH] chore: Add comprehensive PR checks workflow - Add automated linting on pull requests - Add test suite execution across Node 18, 20, 22 - Add build verification to catch build failures early - Add TypeScript type checking - Add code coverage reporting with Codecov - Improves code quality and catches issues before merge Fixes #35 --- .github/workflows/pr-checks.yml | 79 +++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/pr-checks.yml diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml new file mode 100644 index 0000000..fe5873a --- /dev/null +++ b/.github/workflows/pr-checks.yml @@ -0,0 +1,79 @@ +name: PR Checks + +on: + pull_request: + branches: [ main ] + push: + branches: [ main ] + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Run linter + run: npm run lint + + test: + name: Test + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18, 20, 22] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Run tests + run: npm test + - name: Upload coverage + if: matrix.node-version == 20 + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: false + + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Build project + run: npm run build + - name: Check build artifacts + run: | + if [ ! -d "dist" ]; then + echo "Build failed: dist directory not found" + exit 1 + fi + + type-check: + name: Type Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Run type check + run: npx tsc --noEmit