1414 runs-on : ubuntu-latest
1515 strategy :
1616 matrix :
17- node-version : ['12.14.1', '12. x', '14.x']
17+ node-version : ['12.x', '14.x']
1818 steps :
1919 - uses : actions/checkout@v2
2020 with :
@@ -117,6 +117,58 @@ jobs:
117117 name : benchmarkstats.json
118118 path : packages/swingset-runner/benchstats*.json
119119
120+ coverage :
121+ needs : build
122+ runs-on : ubuntu-latest
123+ strategy :
124+ matrix :
125+ node-version : ['14.x']
126+ if : ${{github.event_name == 'push' && github.ref == 'refs/heads/master'}}
127+ steps :
128+ - uses : actions/setup-node@v1
129+ with :
130+ node-version : ${{ matrix.node-version }}
131+ # BEGIN-RESTORE-BOILERPLATE
132+ - name : restore built files
133+ id : built
134+ uses : actions/cache@v1
135+ with :
136+ path : .
137+ key : ${{ runner.os }}-${{ matrix.node-version }}-built-${{ github.sha }}
138+ - uses : actions/checkout@v2
139+ with :
140+ submodules : ' true'
141+ if : steps.built.outputs.cache-hit != 'true'
142+ - name : yarn install
143+ run : yarn install
144+ if : steps.built.outputs.cache-hit != 'true'
145+ - name : yarn build
146+ run : yarn build
147+ if : steps.built.outputs.cache-hit != 'true'
148+ # END-RESTORE-BOILERPLATE
149+
150+ - name : generate coverage for all tests
151+ run : ' yarn test:c8-all || :'
152+ - name : generate coverage/html reports
153+ run : yarn c8 report --reporter=html-spa --reports-dir=coverage/html --temp-directory=coverage/tmp
154+ - uses : actions/upload-artifact@v2
155+ with :
156+ name : coverage
157+ path : coverage
158+ - name : Find Netlify site ID
159+ run : |
160+ echo "NETLIFY_SITE_ID=$(cat COVERAGE_NETLIFY_SITE_ID)" >> $GITHUB_ENV
161+
162+ - uses : nwtgck/actions-netlify@v1.1
163+ with :
164+ # Production deployment if a commit to master.
165+ production-deploy : ${{ github.ref == 'refs/heads/master' }}
166+ publish-dir : coverage/html
167+ # SECURITY: we don't want to hand out the Github token to this action.
168+ # github-token: ${{ secrets.GITHUB_TOKEN }}
169+ env :
170+ NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
171+
120172# #################
121173# Fast-running tests run as a group:
122174 test-quick :
@@ -125,7 +177,7 @@ jobs:
125177 runs-on : ubuntu-latest
126178 strategy :
127179 matrix :
128- node-version : ['12.14.1', '12. x', '14.x']
180+ node-version : ['12.x', '14.x']
129181 steps :
130182 - uses : actions/setup-node@v1
131183 with :
@@ -254,7 +306,7 @@ jobs:
254306 runs-on : ubuntu-latest
255307 strategy :
256308 matrix :
257- node-version : ['12.14.1', '12. x', '14.x']
309+ node-version : ['12.x', '14.x']
258310 steps :
259311 - uses : actions/setup-node@v1
260312 with :
@@ -320,7 +372,7 @@ jobs:
320372 runs-on : ubuntu-latest
321373 strategy :
322374 matrix :
323- node-version : ['12.14.1', '12. x', '14.x']
375+ node-version : ['12.x', '14.x']
324376 steps :
325377 - uses : actions/setup-node@v1
326378 with :
@@ -358,7 +410,7 @@ jobs:
358410 runs-on : ubuntu-latest
359411 strategy :
360412 matrix :
361- node-version : ['12.14.1', '12. x', '14.x']
413+ node-version : ['12.x', '14.x']
362414 steps :
363415 - uses : actions/setup-node@v1
364416 with :
@@ -405,7 +457,7 @@ jobs:
405457 runs-on : ubuntu-latest
406458 strategy :
407459 matrix :
408- node-version : ['12.14.1', '12. x', '14.x']
460+ node-version : ['12.x', '14.x']
409461 steps :
410462 - uses : actions/setup-node@v1
411463 with :
@@ -450,7 +502,7 @@ jobs:
450502 runs-on : ubuntu-latest
451503 strategy :
452504 matrix :
453- node-version : ['12.14.1', '12. x', '14.x']
505+ node-version : ['12.x', '14.x']
454506 steps :
455507 - uses : actions/setup-node@v1
456508 with :
0 commit comments