-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (62 loc) · 2.58 KB
/
Copy pathci.yml
File metadata and controls
79 lines (62 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
quality-gate:
name: Quality Gate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
# Stage 1: Dependency audit (production deps only; devDep vulns don't affect published packages)
- name: Audit dependencies
run: npm audit --audit-level=high --omit=dev
# Stage 2: Lint
- name: Lint
run: npm run lint
# Stage 3: Build internal workspace dependencies so their dist/index.d.ts
# exists before TypeScript resolves cross-package imports during typecheck.
# Yarn workspaces symlinks packages into node_modules but TypeScript reads
# the `types` field (./dist/index.d.ts) which is absent pre-build.
- name: Build api-grade-core (required for cross-package type checking)
run: npm run build
working-directory: packages/api-grade-core
- name: Build backstage-plugin-api-grade-backend (required for frontend plugin type checking)
run: npm run build
working-directory: packages/backstage-plugin-api-grade-backend
- name: Type check
run: npm run typecheck --workspaces --if-present && npm run typecheck
# Stage 4: Build CLI so dist/cli/index.js exists before integration tests run.
# Integration tests spawn the compiled CLI binary directly; without this
# build step they fail with Cannot find module '.../dist/cli/index.js'.
- name: Build CLI (required for integration tests)
run: npm run build
# Stage 4: Tests + coverage (root)
- name: Test (root) with coverage
run: npm run test:coverage
# Stage 4: Tests + coverage (workspaces)
- name: Test (api-grade-core) with coverage
run: npm run test:coverage
working-directory: packages/api-grade-core
- name: Test (backstage-plugin-api-grade) with coverage
run: npm run test:coverage
working-directory: packages/backstage-plugin-api-grade
- name: Test (backstage-plugin-api-grade-backend) with coverage
run: npm run test:coverage
working-directory: packages/backstage-plugin-api-grade-backend
- name: Test (api-grade-mcp) with coverage
run: npm run test:coverage
working-directory: packages/api-grade-mcp
# Stage 5: Build
- name: Build
run: npm run build