Skip to content

Commit 80024ca

Browse files
committed
1 parent 1432355 commit 80024ca

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

.github/workflows/test-all-packages.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
- uses: nwtgck/[email protected]
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:

COVERAGE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Coverage reports for the current main branch are published by CI to:
2+
https://agoric-sdk-coverage.netlify.app
3+
4+
You can create a report in any package (including the top-level directory):
5+
6+
```sh
7+
# Get options available for coverage:
8+
yarn c8 --help
9+
# Run ava under Node.js coverage and display a summary:
10+
yarn c8 ava
11+
# Generate a nice, detailed HTML report:
12+
yarn c8 report --reporter=html-spa --reports-dir=coverage/html
13+
open coverage/html/index.html
14+
```

COVERAGE_NETLIFY_SITE_ID

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
91d78371-7395-4779-8367-0c4f7088297c

0 commit comments

Comments
 (0)