8
8
branches :
9
9
- ' **'
10
10
11
+ env :
12
+ PRIMARY_NODE_VERSION : 12
13
+
11
14
jobs :
12
15
primary_code_validation_and_tests :
13
16
name : Primary code validation and tests
14
17
runs-on : ubuntu-latest
15
18
steps :
16
19
- uses : actions/checkout@v2
17
- - name : Use Node.js 12
20
+ - name : Use Node.js ${{ env.PRIMARY_NODE_VERSION }}
18
21
uses : actions/setup-node@v1
19
22
with :
20
- node-version : 12
23
+ node-version : ${{ env.PRIMARY_NODE_VERSION }}
24
+
25
+ - name : Get yarn cache directory path
26
+ id : yarn-cache-dir-path
27
+ run : echo "::set-output name=dir::$(yarn cache dir)"
28
+
29
+ - uses : actions/cache@v1
30
+ id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
31
+ with :
32
+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
33
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
34
+ restore-keys : |
35
+ ${{ runner.os }}-yarn-
21
36
22
37
# This also runs a build as part of the postinstall bootstrap
23
- - name : install and build
38
+ - name : Install dependencies and build
24
39
run : |
25
40
yarn --ignore-engines --frozen-lockfile
26
41
yarn check-clean-workspace-after-install
27
42
28
- # Note that this command *also* typechecks tests/tools,
43
+ # Note that this command *also* type checks tests/tools,
29
44
# whereas the build only checks src files
30
45
- name : Typecheck all packages
31
46
run : yarn typecheck
44
59
env :
45
60
CI : true
46
61
47
- - name : Run integrations tests
48
- run : yarn integration-tests
49
- env :
50
- CI : true
51
-
52
62
- name : Publish code coverage report
53
63
uses : codecov/codecov-action@v1
54
64
with :
57
67
flags : unittest
58
68
name : codecov
59
69
70
+ integration_tests :
71
+ name : Run integration tests on primary Node.js version
72
+ runs-on : ubuntu-latest
73
+ steps :
74
+ - uses : actions/checkout@v2
75
+ - name : Use Node.js ${{ env.PRIMARY_NODE_VERSION }}
76
+ uses : actions/setup-node@v1
77
+ with :
78
+ node-version : ${{ env.PRIMARY_NODE_VERSION }}
79
+
80
+ - name : Get yarn cache directory path
81
+ id : yarn-cache-dir-path
82
+ run : echo "::set-output name=dir::$(yarn cache dir)"
83
+
84
+ - uses : actions/cache@v1
85
+ id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
86
+ with :
87
+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
88
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
89
+ restore-keys : |
90
+ ${{ runner.os }}-yarn-
91
+
92
+ # This also runs a build as part of the postinstall bootstrap
93
+ - name : Install dependencies and build
94
+ run : |
95
+ yarn --ignore-engines --frozen-lockfile
96
+ yarn check-clean-workspace-after-install
97
+
98
+ - name : Run integrations tests
99
+ run : yarn integration-tests
100
+ env :
101
+ CI : true
102
+
60
103
unit_tests_on_other_node_versions :
61
104
name : Run unit tests on other Node.js versions
62
105
runs-on : ubuntu-latest
@@ -70,8 +113,20 @@ jobs:
70
113
with :
71
114
node-version : ${{ matrix.node-version }}
72
115
116
+ - name : Get yarn cache directory path
117
+ id : yarn-cache-dir-path
118
+ run : echo "::set-output name=dir::$(yarn cache dir)"
119
+
120
+ - uses : actions/cache@v1
121
+ id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
122
+ with :
123
+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
124
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
125
+ restore-keys : |
126
+ ${{ runner.os }}-yarn-
127
+
73
128
# This also runs a build as part of the postinstall bootstrap
74
- - name : install and build
129
+ - name : Install dependencies and build
75
130
run : |
76
131
yarn --ignore-engines --frozen-lockfile
77
132
yarn check-clean-workspace-after-install
@@ -88,19 +143,31 @@ jobs:
88
143
if : github.event_name == 'push' && github.ref == 'refs/head/master'
89
144
steps :
90
145
- uses : actions/checkout@v1
91
- - name : Use Node.js 12
146
+ - name : Use Node.js ${{ env.PRIMARY_NODE_VERSION }}
92
147
uses : actions/setup-node@v1
93
148
with :
94
- node-version : 12
149
+ node-version : ${{ env.PRIMARY_NODE_VERSION }}
95
150
registry-url : https://registry.npmjs.org/
96
151
152
+ - name : Get yarn cache directory path
153
+ id : yarn-cache-dir-path
154
+ run : echo "::set-output name=dir::$(yarn cache dir)"
155
+
156
+ - uses : actions/cache@v1
157
+ id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
158
+ with :
159
+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
160
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
161
+ restore-keys : |
162
+ ${{ runner.os }}-yarn-
163
+
97
164
# This also runs a build as part of the postinstall bootstrap
98
- - name : install and build
165
+ - name : Install dependencies and build
99
166
run : |
100
167
yarn --ignore-engines --frozen-lockfile
101
168
yarn check-clean-workspace-after-install
102
169
103
- # - name: Publish all packages to npm
104
- # run: npx lerna publish --canary --exact --force-publish --yes
105
- # env:
106
- # NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
170
+ - name : Publish all packages to npm
171
+ run : npx lerna publish --canary --exact --force-publish --yes
172
+ env :
173
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments