generated from scaffold-eth/scaffold-eth
-
Notifications
You must be signed in to change notification settings - Fork 693
63 lines (61 loc) · 1.93 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Unit Tests
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
test-base:
runs-on: ubuntu-latest
steps:
- name: Checkout front end code.
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref}}
- name: Build UI
run: yarn install --frozen-lockfile
- name: Run unit tests
run: yarn test:unit --coverage.reporter=json --outputFile=base-report.json && node ./scripts/fix-coverage-report.js --outputFile base-report.json
- name: Upload Report
uses: actions/upload-artifact@v3
with:
name: base-report
path: base-report.json
test-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout front end code.
uses: actions/checkout@v3
with:
ref: ${{ github.ref}}
- name: Build UI
run: yarn install --frozen-lockfile
- name: Run unit tests
run: yarn test:unit --coverage.reporter=json --outputFile=branch-report.json && node ./scripts/fix-coverage-report.js --outputFile branch-report.json
- name: Upload Report
uses: actions/upload-artifact@v3
with:
name: branch-report
path: branch-report.json
coverageReport:
runs-on: ubuntu-latest
needs: [test-base, test-branch]
permissions:
pull-requests: write
contents: write
steps:
- name: Download Base Report
uses: actions/download-artifact@v3
with:
name: base-report
- name: Download Branch Report
uses: actions/download-artifact@v3
with:
name: branch-report
- name: Generate Coverage Report
uses: ArtiomTr/jest-coverage-report-action@v2
with:
test-script: yarn test:unit
package-manager: yarn
github-token: ${{ secrets.GITHUB_TOKEN }}
coverage-file: branch-report.json
base-coverage-file: base-report.json
annotations: all