From 4ba82e131aabbdfa20571a7d8d75d97077e02a99 Mon Sep 17 00:00:00 2001 From: Kacper Date: Sat, 13 Dec 2025 13:35:19 +0100 Subject: [PATCH] ci: add GitHub Actions workflow for test suite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added test.yml workflow to run on PRs and pushes to main/master - Runs server tests with coverage on every PR - Uploads coverage reports to Codecov - Added test:server:coverage script to root package.json - Coverage thresholds enforced: 80% lines/functions, 75% branches 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .github/workflows/test.yml | 45 ++++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..e69f4968 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,45 @@ +name: Test Suite + +on: + pull_request: + branches: + - "*" + push: + branches: + - main + - master + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + cache-dependency-path: package-lock.json + + - name: Install dependencies + # Use npm install instead of npm ci to correctly resolve platform-specific + # optional dependencies (e.g., @tailwindcss/oxide, lightningcss binaries) + run: npm install + + - name: Run server tests with coverage + run: npm run test:server:coverage + env: + NODE_ENV: test + + - name: Upload coverage reports + uses: codecov/codecov-action@v4 + if: always() + with: + files: ./apps/server/coverage/coverage-final.json + flags: server + name: server-coverage + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/package.json b/package.json index bb621dd2..26f633db 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "test": "npm run test --workspace=apps/app", "test:headed": "npm run test:headed --workspace=apps/app", "test:server": "npm run test --workspace=apps/server", + "test:server:coverage": "npm run test:cov --workspace=apps/server", "dev:marketing": "npm run dev --workspace=apps/marketing" } }