This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 857
188 lines (173 loc) · 6.02 KB
/
main-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
name: Main tests
on:
merge_group:
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
## `actions-rs/toolchain@v1` overwrite set to false so that
## `rust-toolchain` is always used and the only source of truth.
jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
cancel_others: 'true'
concurrent_skipping: 'same_content_newer'
paths_ignore: '["**/README.md"]'
lighttest:
needs: [skip_check]
if: |
github.event.pull_request.draft == false &&
(github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true')
name: Light unit tests
runs-on: ["${{github.run_id}}", self-hosted, c5.9xlarge]
steps:
- name: Install OpenSSL lib
run: sudo apt-get -y install libssl-dev
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
override: false
- name: Setup golang
uses: actions/setup-go@v3
with:
go-version: ~1.19
# Go cache for building geth-utils
- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install solc
run: |
sudo wget -O /usr/bin/solc https://github.com/ethereum/solidity/releases/download/v0.8.21/solc-static-linux
sudo chmod +x /usr/bin/solc
- name: Update ERC20 git submodule
run: git submodule update --init --recursive --checkout integration-tests/contracts/vendor/openzeppelin-contracts
- name: Run light tests # light tests are run in parallel
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --release --all --all-features --exclude integration-tests --exclude circuit-benchmarks -- --test-threads 24
- name: Run testool internal tests
uses: actions-rs/cargo@v1
with:
command: test
args: --release --manifest-path testool/Cargo.toml
heavytests:
needs: [skip_check]
if: |
github.event.pull_request.draft == false &&
(github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true')
name: Heavy unit tests
runs-on: ["${{github.run_id}}", self-hosted, c5.9xlarge]
steps:
- name: Install OpenSSL lib
run: sudo apt-get -y install libssl-dev
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
override: false
- name: Setup golang
uses: actions/setup-go@v3
with:
go-version: ~1.19
# Go cache for building geth-utils
- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install solc
run: |
sudo wget -O /usr/bin/solc https://github.com/ethereum/solidity/releases/download/v0.8.21/solc-static-linux
sudo chmod +x /usr/bin/solc
- name: Update ERC20 git submodule
run: git submodule update --init --recursive --checkout integration-tests/contracts/vendor/openzeppelin-contracts
- name: Run heavy tests # heavy tests are run serially to avoid OOM
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --release --all --all-features --exclude integration-tests --exclude circuit-benchmarks serial_ -- --ignored --test-threads 1
build:
needs: [skip_check]
if: |
github.event.pull_request.draft == false &&
(github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true')
name: Linux Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
override: false
- name: Add target
run: rustup target add x86_64-unknown-linux-gnu
# Go cache for building geth-utils
- name: Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: build-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install solc
run: |
sudo wget -O /usr/bin/solc https://github.com/ethereum/solidity/releases/download/v0.8.21/solc-static-linux
sudo chmod +x /usr/bin/solc
- name: Update ERC20 git submodule
run: git submodule update --init --recursive --checkout integration-tests/contracts/vendor/openzeppelin-contracts
- name: cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features