Repository navigation
259 lines (224 loc) · 9.32 KB
/
Copy pathci.yml
File metadata and controls
259 lines (224 loc) · 9.32 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
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
name: Rust CI
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'rust/**'
- 'scripts/ci/**'
- 'tests/network/01-ping-node/**'
- 'tests/network/02-run-devnet1/**'
- 'tests/network/05-mining/**'
- 'tests/network/observer-catchup/**'
- 'tests/network/test-lib.sh'
- '.github/workflows/ci.yml'
pull_request:
branches: [main]
paths:
- 'docs/**'
- 'rust/**'
- 'scripts/ci/**'
- 'tests/network/01-ping-node/**'
- 'tests/network/02-run-devnet1/**'
- 'tests/network/05-mining/**'
- 'tests/network/observer-catchup/**'
- 'tests/network/test-lib.sh'
- '.github/workflows/ci.yml'
# The release workflow runs the whole of CI on the commit it builds.
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_HTTP_MULTIPLEXING: "false"
CARGO_NET_RETRY: "10"
RUSTFLAGS: "-D warnings"
jobs:
keys:
name: No live-network keys
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Refuse private keys a live network trusts
run: python3 scripts/ci/check-no-live-keys.py
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.94.1
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo build
uses: actions/cache@v5
with:
path: rust/target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
- name: Install system dependencies
timeout-minutes: 40
run: |
sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu|https://archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources 2>/dev/null || true
grep -ril 'packages.microsoft.com' /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null | xargs -r sudo sed -i 's/^\([^#].*\)$/# disabled for CI: \1/'
sudo apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 update
sudo apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 install -y cmake clang libssl-dev pkg-config
- name: Cargo check
working-directory: rust
run: cargo check --all
- name: Cargo check tests and examples
working-directory: rust
run: cargo check --all --tests --examples
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.94.1
- name: Free runner disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/hostedtoolcache/CodeQL
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo build
uses: actions/cache@v5
with:
path: rust/target
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-test-
- name: Install system dependencies
timeout-minutes: 40
run: |
sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu|https://archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources 2>/dev/null || true
grep -ril 'packages.microsoft.com' /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null | xargs -r sudo sed -i 's/^\([^#].*\)$/# disabled for CI: \1/'
sudo apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 update
sudo apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 install -y cmake clang libssl-dev pkg-config lsof
- name: Run tests
working-directory: rust
# Miner chain tests use fast SHA-256 fixtures; explicit RandomX coverage remains.
run: cargo test --all
- name: Build modal for network smoke test
working-directory: rust
run: cargo build -p modal
- name: Boot and ping two local nodes
working-directory: tests/network/01-ping-node
timeout-minutes: 5
run: |
export PATH="$GITHUB_WORKSPACE/rust/target/debug:$PATH"
bash ./test.sh
- name: Boot and certify a local sequencer round
working-directory: tests/network/02-run-devnet1
timeout-minutes: 5
run: |
export PATH="$GITHUB_WORKSPACE/rust/target/debug:$PATH"
bash ./test.sh
- name: Mine and persist a local block
working-directory: tests/network/05-mining
timeout-minutes: 6
run: |
export PATH="$GITHUB_WORKSPACE/rust/target/debug:$PATH"
bash ./test.sh
- name: Catch up an observer and verify explorer balances
working-directory: tests/network/observer-catchup
timeout-minutes: 6
run: |
export PATH="$GITHUB_WORKSPACE/rust/target/debug:$PATH"
bash ./test.sh
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.94.1
components: clippy
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo build
uses: actions/cache@v5
with:
path: rust/target
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-clippy-
- name: Install system dependencies
timeout-minutes: 40
run: |
sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu|https://archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources 2>/dev/null || true
grep -ril 'packages.microsoft.com' /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null | xargs -r sudo sed -i 's/^\([^#].*\)$/# disabled for CI: \1/'
sudo apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 update
sudo apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 install -y cmake clang libssl-dev pkg-config
- name: Run Clippy
working-directory: rust
run: cargo clippy --all -- -D warnings -A clippy::too_many_arguments
build-release:
name: Build (Release Mode)
runs-on: ubuntu-latest
# Only run on main to verify release compilation - does NOT publish anything
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.94.1
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo release build
uses: actions/cache@v5
with:
path: rust/target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-release-
- name: Install system dependencies
timeout-minutes: 40
run: |
sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu|https://archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources 2>/dev/null || true
grep -ril 'packages.microsoft.com' /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null | xargs -r sudo sed -i 's/^\([^#].*\)$/# disabled for CI: \1/'
sudo apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 update
sudo apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 install -y cmake clang libssl-dev pkg-config
- name: Verify release build compiles
working-directory: rust
run: cargo build --release