-
Notifications
You must be signed in to change notification settings - Fork 4.9k
72 lines (58 loc) · 1.91 KB
/
run-unit-tests.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
64
65
66
67
68
69
70
71
72
name: Run unit tests
on:
push:
branches: [develop, master]
pull_request:
types: [opened,reopened,synchronize]
jobs:
test-unit:
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1, 2, 3, 4, 5, 6]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup environment
uses: metamask/github-tools/.github/actions/setup-environment@main
- name: test:unit:coverage
run: yarn test:unit:coverage --shard=${{ matrix.shard }}/${{ strategy.job-total }}
- name: Rename coverage to shard coverage
run: mv coverage/coverage-final.json coverage/coverage-${{matrix.shard}}.json
- uses: actions/upload-artifact@v4
with:
name: coverage-${{matrix.shard}}
path: coverage/coverage-${{matrix.shard}}.json
test-webpack:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup environment
uses: metamask/github-tools/.github/actions/setup-environment@main
- name: test:unit:webpack:coverage
run: yarn test:unit:webpack:coverage
- name: Rename coverage
run: mv coverage/coverage-final.json coverage/coverage-webpack.json
- uses: actions/upload-artifact@v4
with:
name: coverage-webpack
path: coverage/coverage-webpack.json
report-coverage:
runs-on: ubuntu-latest
needs:
- test-unit
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download coverage from shards
uses: actions/download-artifact@v4
with:
path: coverage
pattern: coverage-*
merge-multiple: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true