File tree Expand file tree Collapse file tree 1 file changed +24
-9
lines changed Expand file tree Collapse file tree 1 file changed +24
-9
lines changed Original file line number Diff line number Diff line change 1
1
name : CI
2
+
2
3
on :
3
4
pull_request :
4
5
push :
7
8
- ' v*'
8
9
env :
9
10
node_version : " 20.x"
11
+ FORCE_COLOR : 3
10
12
11
13
jobs :
12
14
build : # make sure build/ci work properly
@@ -19,12 +21,17 @@ jobs:
19
21
with :
20
22
node-version : ${{ env.node_version }}
21
23
22
- - name : npm install
23
- run : npm install
24
+ - name : npm ci
25
+ run : npm ci --prefer-offline
24
26
25
- - name : npm run pack
27
+ - name : npm run package
26
28
run : npm run package
27
29
30
+ - name : Check for any changed files
31
+ run : |
32
+ [[ -z $(git status --untracked-files=no --porcelain) ]] || \
33
+ (echo "::error title=npm run package::Files in the /dist directory shouldn't have changed. You forgot to run 'npm run package'." && exit 1)
34
+
28
35
audit :
29
36
name : Audit
30
37
runs-on : ubuntu-latest
36
43
with :
37
44
node-version : ${{ env.node_version }}
38
45
46
+ # We don't need to install deps to audit them
47
+
39
48
- name : npm audit
40
49
run : npm audit --audit-level=critical
41
50
@@ -49,15 +58,16 @@ jobs:
49
58
uses : actions/setup-node@v4
50
59
with :
51
60
node-version : ${{ env.node_version }}
61
+ cache : npm
62
+ cache-dependency-path : ' **/package-lock.json'
52
63
53
- - name : npm install
54
- run : npm install
64
+ - name : npm ci
65
+ run : npm ci --prefer-offline
55
66
56
67
- name : npm lint
57
68
run : npm run lint
58
69
59
- # When tests are added to the code uncomment
60
- # test-code:
70
+ # test:
61
71
# name: Test
62
72
# runs-on: ubuntu-latest
63
73
# steps:
67
77
# uses: actions/setup-node@v4
68
78
# with:
69
79
# node-version: ${{ env.node_version }}
80
+ # cache: npm
81
+ # cache-dependency-path: '**/package-lock.json'
70
82
#
71
- # - name: npm install
72
- # run: npm install
83
+ # - name: npm ci
84
+ # run: npm ci --prefer-offline
73
85
#
74
86
# - name: npm test
75
87
# run: npm test
88
+ #
89
+ # - name: Report test coverage to Codecov
90
+ # uses: codecov/codecov-action@v3
You can’t perform that action at this time.
0 commit comments