mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
ci: add GitHub Actions workflow for test suite
- 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 <noreply@anthropic.com>
This commit is contained in:
45
.github/workflows/test.yml
vendored
Normal file
45
.github/workflows/test.yml
vendored
Normal file
@@ -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 }}
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user