Skip to content

Commit 6cda002

Browse files
committed
feat(ci): separate linting from tests
1 parent 5bbf4b8 commit 6cda002

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

.github/workflows/test.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,29 @@ on:
55
branches: ['*'] # or change to match your default branch
66
push:
77
branches: ['*']
8+
workflow_dispatch:
89

910
jobs:
1011
test:
1112
runs-on: ubuntu-latest
1213

14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Use Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 22.13.1
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run Jest tests
27+
run: npm run ci:test
28+
test-coverage:
29+
runs-on: ubuntu-latest
30+
1331
steps:
1432
- name: Checkout code
1533
uses: actions/checkout@v3
@@ -23,7 +41,24 @@ jobs:
2341
run: npm ci
2442

2543
- name: Run Jest tests with coverage
26-
run: npm run ci
44+
run: npm run ci:test:coverage
45+
lint:
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- name: Checkout code
50+
uses: actions/checkout@v4
51+
52+
- name: Use Node.js
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: 22.13.1
56+
57+
- name: Install dependencies
58+
run: npm ci
59+
60+
- name: Run linting
61+
run: npm run lint
2762

28-
- name: Check coverage thresholds
29-
run: npm run test:check-coverage-thresholds
63+
- name: Check formatting with prettier
64+
run: npm run format:check

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"analyze-bundle": "ng build --configuration=analyze-bundle && source-map-explorer dist/**/*.js --no-border-checks",
77
"build": "ng build",
88
"ci": "npm run lint && jest --coverage",
9+
"ci:test": "jest",
10+
"ci:test:coverage": "jest --coverage",
911
"docs": "./node_modules/.bin/compodoc -p tsconfig.docs.json --name 'OSF Angular Documentation' --theme 'laravel' -s",
1012
"docs:coverage": "./node_modules/.bin/compodoc -p tsconfig.docs.json --coverageTest 0 --coverageMinimumPerFile 0",
1113
"lint": "ng lint",

0 commit comments

Comments
 (0)