1
1
name : uvic-course-scraper
2
2
3
3
on :
4
- push :
5
- branches : [master]
6
- pull_request :
7
- branches : [master]
4
+ push :
5
+ branches : [ master ]
6
+ pull_request :
7
+ branches : [ master ]
8
8
9
9
jobs :
10
- # This workflow contains a single job called "build"
11
- lint :
12
- name : lint
13
- runs-on : ubuntu-latest
14
- steps :
15
- - name : Checkout
16
- uses : actions/checkout@v2
17
-
18
- - name : Setup Node.js
19
- uses : actions/setup-node@v1
20
- with :
21
- node-version : 12
22
- - name : Cache npm dependencies
23
- uses : actions/cache@v1
24
- with :
25
- key : npm-${{ hashFiles('package-lock.json') }}
26
- path : ~/.npm
27
- restore-keys : |
28
- npm-
29
- - name : Install dependencies
30
- run : npm ci --ignore-scripts --no-audit --no-progress
31
- - name : Lint
32
- run : npm run lint
33
-
34
- test :
35
- name : test
36
- runs-on : ubuntu-latest
37
- steps :
38
- - name : Checkout
39
- uses : actions/checkout@v2
40
-
41
- - name : Setup Node.js
42
- uses : actions/setup-node@v1
43
- with :
44
- node-version : 12
45
- - name : Cache npm dependencies
46
- uses : actions/cache@v1
47
- with :
48
- key : npm-${{ hashFiles('package-lock.json') }}
49
- path : ~/.npm
50
- restore-keys : |
51
- npm-
52
- - name : Install dependencies
53
- run : npm ci --ignore-scripts --no-audit --no-progress
54
- - name : test
55
- run : npm test -- --coverage
56
- - name : Upload coverage to Codecov
57
- uses : codecov/codecov-action@v1
58
- with :
59
- name : codecov-umbrella # optional
60
- fail_ci_if_error : true # optional (default = false)
61
- verbose : true # optional (default = false)
62
- build :
63
- name : build
64
- runs-on : ubuntu-latest
65
- steps :
66
- - name : Checkout
67
- uses : actions/checkout@v2
68
-
69
- - name : Setup Node.js
70
- uses : actions/setup-node@v1
71
- with :
72
- node-version : 12
73
- - name : Cache npm dependencies
74
- uses : actions/cache@v1
75
- with :
76
- key : npm-${{ hashFiles('package-lock.json') }}
77
- path : ~/.npm
78
- restore-keys : |
79
- npm-
80
- - name : Install dependencies
81
- run : npm ci --ignore-scripts --no-audit --no-progress
82
- - name : build
83
- run : npm run build
10
+ lint :
11
+ name : lint
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - name : Checkout
15
+ uses : actions/checkout@v2
16
+
17
+ - name : Setup Node.js
18
+ uses : actions/setup-node@v1
19
+ with :
20
+ node-version : 12
21
+
22
+ - name : Cache npm dependencies
23
+ uses : actions/cache@v1
24
+ with :
25
+ key : npm-${{ hashFiles('package-lock.json') }}
26
+ path : ~/.npm
27
+ restore-keys : |
28
+ npm-
29
+
30
+ - name : Install dependencies
31
+ run : npm ci --ignore-scripts --no-audit --no-progress
32
+
33
+ - name : Lint
34
+ run : npm run lint
35
+
36
+ build :
37
+ name : build
38
+ runs-on : ubuntu-latest
39
+ steps :
40
+ - name : Checkout
41
+ uses : actions/checkout@v2
42
+
43
+ - name : Setup Node.js
44
+ uses : actions/setup-node@v1
45
+ with :
46
+ node-version : 12
47
+
48
+ - name : Cache npm dependencies
49
+ uses : actions/cache@v1
50
+ with :
51
+ key : npm-${{ hashFiles('package-lock.json') }}
52
+ path : ~/.npm
53
+ restore-keys : |
54
+ npm-
55
+
56
+ - name : Install dependencies
57
+ run : npm ci --ignore-scripts --no-audit --no-progress
58
+
59
+ - name : Build
60
+ run : npm run build
61
+
62
+ test :
63
+ name : test
64
+ runs-on : ubuntu-latest
65
+ steps :
66
+ - name : Checkout
67
+ uses : actions/checkout@v2
68
+
69
+ - name : Setup Node.js
70
+ uses : actions/setup-node@v1
71
+ with :
72
+ node-version : 12
73
+
74
+ - name : Cache npm dependencies
75
+ uses : actions/cache@v1
76
+ with :
77
+ key : npm-${{ hashFiles('package-lock.json') }}
78
+ path : ~/.npm
79
+ restore-keys : |
80
+ npm-
81
+
82
+ - name : Install dependencies
83
+ run : npm ci --ignore-scripts --no-audit --no-progress
84
+
85
+ - name : Test
86
+ run : npm test -- --coverage
87
+
88
+ - name : Upload coverage to Codecov
89
+ uses : codecov/codecov-action@v1
90
+ with :
91
+ name : codecov-umbrella # optional
92
+ fail_ci_if_error : true # optional (default = false)
93
+ verbose : true # optional (default = false)
94
+
95
+ publish-npm :
96
+ if : github.ref == 'refs/heads/master'
97
+ needs : [ lint, build, test ]
98
+ environment : deployment
99
+ runs-on : ubuntu-latest
100
+ steps :
101
+ - name : Checkout
102
+ uses : actions/checkout@v2
103
+
104
+ - name : Setup Node.js
105
+ uses : actions/setup-node@v1
106
+ with :
107
+ node-version : 12
108
+
109
+ - name : Cache npm dependencies
110
+ uses : actions/cache@v1
111
+ with :
112
+ key : npm-${{ hashFiles('package-lock.json') }}
113
+ path : ~/.npm
114
+ restore-keys : |
115
+ npm-
116
+
117
+ - name : Install dependencies
118
+ run : npm ci --ignore-scripts --no-audit --no-progress
119
+
120
+ - name : Bump minor version
121
+ uses : ' phips28/gh-action-bump-version@master'
122
+ env :
123
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
124
+
125
+ - name : Create .npmrc for auth token publishing
126
+ run : echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
127
+ env :
128
+ # token must be generated by admin account to vikelabs org, currently gnomi
129
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
130
+
131
+ - name : Build and publish npm package
132
+ run : npm run build && npm publish --access public
0 commit comments