-
Notifications
You must be signed in to change notification settings - Fork 26
180 lines (159 loc) · 5.8 KB
/
Copy pathtest-report.yml
File metadata and controls
180 lines (159 loc) · 5.8 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: test-report
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: read
actions: read
checks: write
jobs:
test-fabric:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- run: npm run build:console
- name: Run mocha tests and generate json report
run: |
set -e
mkdir -p reports
NODE_ENV=testing BDK_PATH=$(pwd)/test/bdk BDK_DOCKER_HOST_PATH=$(pwd)/test/bdk npx nyc --silent --temp-dir ./coverage/fabric/.nyc_output --report-dir ./coverage/fabric npx mocha --reporter json --require ts-node/register './test/fabric/**/*.test.ts' --exit > reports/fabric.json || echo '{}' > reports/fabric.json
echo 'Coverage summary:'
npx nyc report --temp-dir ./coverage/fabric/.nyc_output --report-dir ./coverage/fabric --reporter=text
- name: Upload Fabric JSON
uses: actions/upload-artifact@v4
with:
name: mocha-fabric
path: reports/fabric.json
retention-days: 1
- name: Show Fabric test
run: cat reports/fabric.json
test-besu:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- run: npm run build:console
- name: Install solc 0.8.17
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-pip curl
pip3 install solc-select
solc-select install 0.8.17
solc-select use 0.8.17
solc --version
- name: Run mocha tests and generate json report
run: |
set -e
mkdir -p reports
echo '--- List test files ---'
ls -lR test/eth/besu || true
echo '--- Mocha version ---'
npx mocha --version || true
echo '--- Run Mocha with nyc and env ---'
NODE_ENV=testing BDK_PATH=$(pwd)/test/bdk BDK_DOCKER_HOST_PATH=$(pwd)/test/bdk npx nyc --silent --temp-dir ./coverage/besu/.nyc_output --report-dir ./coverage/besu npx mocha --reporter json --require ts-node/register './test/eth/besu/**/*.test.ts' --exit > reports/besu.json || echo '{}' > reports/besu.json
echo 'Coverage summary:'
npx nyc report --temp-dir ./coverage/besu/.nyc_output --report-dir ./coverage/besu --reporter=text
- name: Upload Besu JSON
uses: actions/upload-artifact@v4
with:
name: mocha-besu
path: reports/besu.json
retention-days: 1
- name: Show Besu test
run: cat reports/besu.json
test-quorum:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- run: npm run build:console
- name: Install solc 0.8.17
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-pip curl
pip3 install solc-select
solc-select install 0.8.17
solc-select use 0.8.17
solc --version
- name: Run mocha tests and generate json report
run: |
set -e
mkdir -p reports
NODE_ENV=testing BDK_PATH=$(pwd)/test/bdk BDK_DOCKER_HOST_PATH=$(pwd)/test/bdk npx nyc --silent --temp-dir ./coverage/quorum/.nyc_output --report-dir ./coverage/quorum npx mocha --reporter json --require ts-node/register './test/eth/quorum/**/*.test.ts' --exit > reports/quorum.json || echo '{}' > reports/quorum.json
echo 'Coverage summary:'
npx nyc report --temp-dir ./coverage/quorum/.nyc_output --report-dir ./coverage/quorum --reporter=text
- name: Upload Quorum JSON
uses: actions/upload-artifact@v4
with:
name: mocha-quorum
path: reports/quorum.json
retention-days: 1
- name: Show Quorum test
run: cat reports/quorum.json
test-others:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- run: npm run build:console
- name: Run mocha tests and generate json report
run: |
set -e
mkdir -p reports
NODE_ENV=testing BDK_PATH=$(pwd)/test/bdk BDK_DOCKER_HOST_PATH=$(pwd)/test/bdk npx nyc --silent --temp-dir ./coverage/others/.nyc_output --report-dir ./coverage/others npx mocha --reporter json --require ts-node/register './test/{hello,wallet,bdk}/**/*.test.ts' --exit > reports/others.json || echo '{}' > reports/others.json
echo 'Coverage summary:'
npx nyc report --temp-dir ./coverage/others/.nyc_output --report-dir ./coverage/others --reporter=text
- name: Upload Others JSON
uses: actions/upload-artifact@v4
with:
name: mocha-others
path: reports/others.json
retention-days: 1
- name: Show Others test
run: cat reports/others.json
report:
runs-on: ubuntu-22.04
needs: [test-fabric, test-besu, test-quorum, test-others]
if: success() || failure()
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
pattern: mocha-*
path: reports/
- uses: dorny/test-reporter@v1
with:
name: mocha-report
path: 'reports/**/*.json'
reporter: mocha-json