@@ -117,6 +117,57 @@ 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+ # TODO: Don't trigger on all events
127+ # if: ${{github.event_name == 'push' && github.ref == 'refs/heads/master'}}
128+ steps :
129+ - uses : actions/setup-node@v1
130+ with :
131+ node-version : ${{ matrix.node-version }}
132+ # BEGIN-RESTORE-BOILERPLATE
133+ - name : restore built files
134+ id : built
135+ uses : actions/cache@v1
136+ with :
137+ path : .
138+ key : ${{ runner.os }}-${{ matrix.node-version }}-built-${{ github.sha }}
139+ - uses : actions/checkout@v2
140+ with :
141+ submodules : ' true'
142+ if : steps.built.outputs.cache-hit != 'true'
143+ - name : yarn install
144+ run : yarn install
145+ if : steps.built.outputs.cache-hit != 'true'
146+ - name : yarn build
147+ run : yarn build
148+ if : steps.built.outputs.cache-hit != 'true'
149+ # END-RESTORE-BOILERPLATE
150+
151+ - name : generate coverage for all tests
152+ run : ' yarn c8 ava --reporter=none || :'
153+ - name : generate coverage/html reports
154+ run : yarn c8 report --reporter=html-spa --reports-dir=coverage/html --temp-directory=coverage/tmp
155+ - uses : actions/upload-artifact@v2
156+ with :
157+ name : coverage
158+ path : coverage
159+ - name : Find Netlify site ID
160+ run : |
161+ echo "NETLIFY_SITE_ID=$(cat COVERAGE_NETLIFY_SITE_ID)" >> $GITHUB_ENV
162+ 163+ with :
164+ # Production deployment if a commit to master.
165+ production-deploy : ${{ github.ref == 'refs/heads/master' }}
166+ publish-dir : coverage/html
167+ github-token : ${{ secrets.GITHUB_TOKEN }}
168+ env :
169+ NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
170+
120171# #################
121172# Fast-running tests run as a group:
122173 test-quick :
0 commit comments