Skip to content

Commit e0902ef

Browse files
authored
Merge pull request #66 from ndycode/ci/pr-workflow
ci(actions): add dedicated pull request workflow
2 parents d4d884c + 0aae5a0 commit e0902ef

2 files changed

Lines changed: 54 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name: CI
33
on:
44
push:
55
branches: [main]
6-
pull_request:
7-
branches: [main]
86

97
jobs:
108
test:
@@ -23,7 +21,7 @@ jobs:
2321
uses: actions/setup-node@v4
2422
with:
2523
node-version: ${{ matrix.node-version }}
26-
cache: 'npm'
24+
cache: npm
2725

2826
- name: Install dependencies
2927
run: npm ci
@@ -52,7 +50,6 @@ jobs:
5250

5351
lint:
5452
name: Lint
55-
5653
runs-on: ubuntu-latest
5754

5855
steps:
@@ -63,7 +60,7 @@ jobs:
6360
uses: actions/setup-node@v4
6461
with:
6562
node-version: 20.x
66-
cache: 'npm'
63+
cache: npm
6764

6865
- name: Install dependencies
6966
run: npm ci
@@ -83,7 +80,7 @@ jobs:
8380
uses: actions/setup-node@v4
8481
with:
8582
node-version: 20.x
86-
cache: 'npm'
83+
cache: npm
8784

8885
- name: Install dependencies
8986
run: npm ci

.github/workflows/pr-ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: PR CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
concurrency:
8+
group: pr-ci-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
validate:
16+
name: PR Validation
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 20.x
27+
cache: npm
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Security audit (CI policy)
33+
run: npm run audit:ci
34+
35+
- name: Lockfile floor guard
36+
run: npm run test -- test/lockfile-version-floor.test.ts
37+
38+
- name: Repository hygiene check
39+
run: npm run clean:repo:check
40+
41+
- name: Run type check
42+
run: npm run typecheck
43+
44+
- name: Run ESLint
45+
run: npm run lint
46+
47+
- name: Run tests
48+
run: npm test
49+
50+
- name: Build
51+
run: npm run build

0 commit comments

Comments
 (0)