forked from NethermindEth/nethermind
-
Notifications
You must be signed in to change notification settings - Fork 0
206 lines (198 loc) · 6.75 KB
/
nethermind-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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Nethermind/Ethereum tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches: [master]
workflow_dispatch:
inputs:
coverage:
default: false
description: Collect coverage
required: false
type: boolean
env:
COLLECT_COVERAGE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' || github.event.inputs.coverage }}
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1
RETENTION: 1
TERM: xterm
jobs:
nethermind-tests:
name: Run ${{ matrix.project }}
runs-on: ubuntu-latest
continue-on-error: true
outputs:
collect_coverage: ${{ env.COLLECT_COVERAGE }}
strategy:
matrix:
project:
- Nethermind.Abi.Test
- Nethermind.AccountAbstraction.Test
- Nethermind.Api.Test
- Nethermind.AuRa.Test
- Nethermind.Blockchain.Test
- Nethermind.Cli.Test
- Nethermind.Clique.Test
- Nethermind.Config.Test
- Nethermind.Consensus.Test
- Nethermind.Core.Test
- Nethermind.Db.Test
- Nethermind.Ethash.Test
- Nethermind.EthStats.Test
- Nethermind.Evm.Test
- Nethermind.Facade.Test
- Nethermind.HealthChecks.Test
- Nethermind.Hive.Test
- Nethermind.JsonRpc.Test
- Nethermind.JsonRpc.TraceStore.Test
- Nethermind.KeyStore.Test
- Nethermind.Logging.NLog.Test
- Nethermind.Merge.AuRa.Test
- Nethermind.Merge.Plugin.Test
- Nethermind.Mev.Test
- Nethermind.Mining.Test
- Nethermind.Monitoring.Test
- Nethermind.Network.Discovery.Test
- Nethermind.Network.Dns.Test
- Nethermind.Network.Enr.Test
- Nethermind.Network.Test
- Nethermind.Overseer.Test
- Nethermind.Runner.Test
- Nethermind.Serialization.Ssz.Test
- Nethermind.Sockets.Test
- Nethermind.Specs.Test
- Nethermind.State.Test
- Nethermind.State.Test.Runner.Test
- Nethermind.Synchronization.Test
- Nethermind.Trie.Test
- Nethermind.TxPool.Test
- Nethermind.Wallet.Test
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v4
- name: Install Linux packages
run: |
sudo apt-get update
sudo apt-get install libsnappy-dev -y --no-install-recommends
- name: ${{ matrix.project }}
id: test
run: |
dotnet test src/Nethermind/${{ matrix.project }} -c release \
${{ env.COLLECT_COVERAGE == 'true' && '-p:CollectCoverage=true -p:CoverletOutputFormat=opencover' || '' }}
- name: Save test outcome
if: success() || failure()
run: echo "${{ steps.test.outcome == 'success' }}," >> nethermind.outcome
- name: Upload test outcome
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-outcome
path: nethermind.outcome
retention-days: ${{ env.RETENTION }}
- name: Upload coverage report
if: env.COLLECT_COVERAGE == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-coverage
path: src/Nethermind/${{ matrix.project }}/coverage.opencover.xml
retention-days: ${{ env.RETENTION }}
nethermind-tests-status:
name: Nethermind tests
needs: nethermind-tests
runs-on: ubuntu-latest
steps:
- name: Download test outcomes
uses: actions/download-artifact@v4
- name: Ensure tests passed
run: |
data=$(cat **/nethermind.outcome) && data=${data%?}
passed=$(echo "[$data]" | jq -r 'all')
[ $passed = 'true' ] && exit 0 || exit 1
ethereum-tests:
name: Run ${{ matrix.project }}
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
project:
- Ethereum.Abi.Test
- Ethereum.Basic.Test
- Ethereum.Blockchain.Block.Legacy.Test
- Ethereum.Blockchain.Block.Test
- Ethereum.Blockchain.Legacy.Test
- Ethereum.Blockchain.Pyspec.Test
- Ethereum.Blockchain.Test
- Ethereum.Difficulty.Test
- Ethereum.HexPrefix.Test
- Ethereum.KeyAddress.Test
- Ethereum.PoW.Test
- Ethereum.Rlp.Test
- Ethereum.Transaction.Test
- Ethereum.Transition.Test
- Ethereum.Trie.Test
- Ethereum.VM.Test
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up .NET
uses: actions/setup-dotnet@v4
- name: Install Linux packages
run: |
sudo apt-get update
sudo apt-get install libsnappy-dev -y --no-install-recommends
- name: ${{ matrix.project }}
id: test
run: |
dotnet test src/Nethermind/${{ matrix.project }} -c release \
${{ env.COLLECT_COVERAGE == 'true' && '-p:CollectCoverage=true -p:CoverletOutputFormat=opencover -p:Exclude="[Nethermind.Core.Test]*%2c[Nethermind.Blockchain.Test]*%2c[Ethereum.Test.Base]*"' || '' }}
- name: Save test outcome
if: success() || failure()
run: echo "${{ steps.test.outcome == 'success' }}," >> ethereum.outcome
- name: Upload test outcome
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-outcome
path: ethereum.outcome
retention-days: ${{ env.RETENTION }}
- name: Upload coverage report
if: env.COLLECT_COVERAGE == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-coverage
path: src/Nethermind/${{ matrix.project }}/coverage.opencover.xml
retention-days: ${{ env.RETENTION }}
ethereum-tests-status:
name: Ethereum tests
needs: ethereum-tests
runs-on: ubuntu-latest
steps:
- name: Download test outcomes
uses: actions/download-artifact@v4
- name: Ensure tests passed
run: |
data=$(cat **/ethereum.outcome) && data=${data%?}
passed=$(echo "[$data]" | jq -r 'all')
[ $passed = 'true' ] && exit 0 || exit 1
codecov-upload:
name: Upload Codecov reports
needs: [nethermind-tests-status, ethereum-tests-status]
if: needs.nethermind-tests.outputs.collect_coverage == 'true'
runs-on: ubuntu-latest
steps:
- name: Download coverage reports
uses: actions/download-artifact@v4
with:
path: .coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-nethermind
directory: .coverage