Skip to content

Commit f63c8d7

Browse files
authored
ci: split ci workflow (paradigmxyz#1345)
1 parent d216081 commit f63c8d7

14 files changed

+343
-197
lines changed

.github/workflows/bench.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
7+
env:
8+
RUSTFLAGS: -D warnings
9+
CARGO_TERM_COLOR: always
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
name: bench
16+
jobs:
17+
iai:
18+
# Pin to `20.04` instead of `ubuntu-latest`, until ubuntu-latest migration is complete
19+
# See also <https://github.com/foundry-rs/foundry/issues/3827>
20+
runs-on: ubuntu-20.04
21+
steps:
22+
- name: Install Valgrind
23+
run: |
24+
sudo apt install valgrind
25+
26+
- name: Checkout PR sources
27+
uses: actions/checkout@v3
28+
with:
29+
ref: main
30+
31+
- uses: Swatinem/rust-cache@v1
32+
with:
33+
cache-on-failure: true
34+
35+
- name: Generate test vectors
36+
uses: actions-rs/cargo@v1
37+
with:
38+
command: run
39+
args: --bin reth -- test-vectors tables
40+
41+
- name: Set main baseline
42+
uses: actions-rs/cargo@v1
43+
with:
44+
command: bench
45+
args: --package reth-db --bench iai
46+
47+
- name: Checkout main sources
48+
uses: actions/checkout@v3
49+
with:
50+
clean: false
51+
52+
- name: Compare PR benchmark
53+
shell: 'script -q -e -c "bash {0}"' # required to workaround /dev/tty not being available
54+
run: |
55+
./.github/scripts/compare_iai.sh

.github/workflows/ci.yml

+2-197
Original file line numberDiff line numberDiff line change
@@ -7,161 +7,15 @@ on:
77
env:
88
RUSTFLAGS: -D warnings
99
CARGO_TERM_COLOR: always
10-
GETH_BUILD: 1.10.26-e5eb32ac
1110

1211
concurrency:
1312
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1413
cancel-in-progress: true
1514

1615
name: ci
1716
jobs:
18-
test:
19-
# Pin to `20.04` instead of `ubuntu-latest`, until ubuntu-latest migration is complete
20-
# See also <https://github.com/foundry-rs/foundry/issues/3827>
21-
runs-on: ubuntu-20.04
22-
steps:
23-
- name: Checkout sources
24-
uses: actions/checkout@v3
25-
- name: Install toolchain
26-
uses: dtolnay/rust-toolchain@stable
27-
with:
28-
components: llvm-tools-preview
29-
- uses: Swatinem/rust-cache@v2
30-
with:
31-
cache-on-failure: true
32-
33-
- name: Install geth
34-
run: |
35-
mkdir -p "$HOME/bin"
36-
wget -q https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-$GETH_BUILD.tar.gz
37-
tar -xvf geth-linux-amd64-$GETH_BUILD.tar.gz
38-
mv geth-linux-amd64-$GETH_BUILD/geth $HOME/bin/geth
39-
chmod u+x "$HOME/bin/geth"
40-
export PATH=$HOME/bin:$PATH
41-
echo $HOME/bin >> $GITHUB_PATH
42-
geth version
43-
44-
- name: Install latest nextest release
45-
uses: taiki-e/install-action@nextest
46-
- name: Install cargo-llvm-cov
47-
uses: taiki-e/install-action@cargo-llvm-cov
48-
49-
- name: Run tests
50-
run: cargo llvm-cov nextest --lcov --output-path lcov.info --locked --workspace --all-features
51-
52-
- name: Upload coverage data to codecov
53-
uses: codecov/codecov-action@v3
54-
with:
55-
token: ${{ secrets.CODECOV_TOKEN }}
56-
files: lcov.info
57-
flags: unit-tests
58-
59-
eth-blockchain:
60-
name: ethereum blockchain tests (stable)
61-
runs-on: ubuntu-latest
62-
env:
63-
RUST_LOG: info,sync=error
64-
steps:
65-
- name: Checkout sources
66-
uses: actions/checkout@v2
67-
68-
- name: Checkout ethereum/tests
69-
uses: actions/checkout@v2
70-
with:
71-
repository: ethereum/tests
72-
path: ethtests
73-
submodules: recursive
74-
75-
- name: Install toolchain
76-
uses: actions-rs/toolchain@v1
77-
with:
78-
toolchain: stable
79-
profile: minimal
80-
override: true
81-
82-
- uses: Swatinem/rust-cache@v1
83-
with:
84-
cache-on-failure: true
85-
86-
- name: Run Ethereum tests
87-
run: cargo run --release -- test-chain ethtests/BlockchainTests/GeneralStateTests/
88-
89-
eth-sync:
90-
name: ethereum blockchain sync (${{ matrix.profile }}; 100k blocks)
91-
strategy:
92-
matrix:
93-
profile: [release, dev]
94-
runs-on: ubuntu-latest
95-
env:
96-
RUST_LOG: info,sync=error
97-
steps:
98-
- name: Checkout sources
99-
uses: actions/checkout@v2
100-
101-
- name: Install toolchain
102-
uses: actions-rs/toolchain@v1
103-
with:
104-
toolchain: stable
105-
profile: minimal
106-
107-
- uses: Swatinem/rust-cache@v1
108-
with:
109-
cache-on-failure: true
110-
111-
- name: Run Sync (debug)
112-
run: cargo run --profile ${{ matrix.profile }} --bin reth -- node --debug.tip 0x91c90676cab257a59cd956d7cb0bceb9b1a71d79755c23c7277a0697ccfaf8c4 --debug.max-block 100000
113-
114-
fuzz:
115-
# Skip the Fuzzing Jobs until we make them run fast and reliably. Currently they will
116-
# always recompile the codebase for each test and that takes way too long.
117-
if: false
118-
119-
# Pin to `20.04` instead of `ubuntu-latest`, until ubuntu-latest migration is complete
120-
# See also <https://github.com/foundry-rs/foundry/issues/3827>
121-
runs-on: ubuntu-20.04
122-
strategy:
123-
matrix:
124-
target:
125-
- reth-primitives
126-
- reth-db
127-
- reth-eth-wire
128-
- reth-codecs
129-
steps:
130-
- name: Checkout sources
131-
uses: actions/checkout@v3
132-
- name: Install toolchain
133-
uses: dtolnay/rust-toolchain@stable
134-
with:
135-
components: llvm-tools-preview
136-
- uses: Swatinem/rust-cache@v2
137-
with:
138-
cache-on-failure: true
139-
140-
- name: Install fuzzer
141-
uses: actions-rs/cargo@v1
142-
with:
143-
command: install
144-
args: cargo-test-fuzz afl
145-
- name: Force install cargo-afl
146-
run: |
147-
cargo install --force afl
148-
cargo afl --version
149-
- name: Install cargo-llvm-cov
150-
uses: taiki-e/install-action@cargo-llvm-cov
151-
152-
- name: Run fuzz tests
153-
run: |
154-
./.github/scripts/fuzz.sh ${{ matrix.target }}
155-
env:
156-
AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES: 1
157-
- name: Upload coverage data to codecov
158-
uses: codecov/codecov-action@v3
159-
with:
160-
token: ${{ secrets.CODECOV_TOKEN }}
161-
files: lcov.info
162-
flags: fuzz-tests
163-
16417
lint:
18+
name: code lint
16519
# Pin to `20.04` instead of `ubuntu-latest`, until ubuntu-latest migration is complete
16620
# See also <https://github.com/foundry-rs/foundry/issues/3827>
16721
runs-on: ubuntu-20.04
@@ -188,17 +42,8 @@ jobs:
18842
args: --all --all-features
18943
token: ${{ secrets.GITHUB_TOKEN }}
19044

191-
doc-test:
192-
runs-on: ubuntu-latest
193-
steps:
194-
- uses: actions/checkout@v3
195-
- name: Install toolchain
196-
uses: dtolnay/rust-toolchain@stable
197-
- uses: Swatinem/rust-cache@v2
198-
- name: Run doctests
199-
run: cargo test --doc --all --all-features
200-
20145
doc-lint:
46+
name: doc lint
20247
runs-on: ubuntu-latest
20348
steps:
20449
- uses: actions/checkout@v3
@@ -207,43 +52,3 @@ jobs:
20752
- uses: Swatinem/rust-cache@v2
20853
- name: Check if documentation builds
20954
run: RUSTDOCFLAGS="-D warnings" cargo doc --all --no-deps --all-features --document-private-items
210-
211-
benchmarks:
212-
# Pin to `20.04` instead of `ubuntu-latest`, until ubuntu-latest migration is complete
213-
# See also <https://github.com/foundry-rs/foundry/issues/3827>
214-
runs-on: ubuntu-20.04
215-
steps:
216-
- name: Install Valgrind
217-
run: |
218-
sudo apt install valgrind
219-
220-
- name: Checkout PR sources
221-
uses: actions/checkout@v3
222-
with:
223-
ref: main
224-
225-
- uses: Swatinem/rust-cache@v1
226-
with:
227-
cache-on-failure: true
228-
229-
- name: Generate test-vectors
230-
uses: actions-rs/cargo@v1
231-
with:
232-
command: run
233-
args: --bin reth -- test-vectors tables
234-
235-
- name: Set main baseline
236-
uses: actions-rs/cargo@v1
237-
with:
238-
command: bench
239-
args: --package reth-db --bench iai
240-
241-
- name: Checkout main sources
242-
uses: actions/checkout@v3
243-
with:
244-
clean: false
245-
246-
- name: Compare PR benchmark
247-
shell: 'script -q -e -c "bash {0}"' # required to workaround /dev/tty not being available
248-
run: |
249-
./.github/scripts/compare_iai.sh

.github/workflows/fuzz.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
7+
env:
8+
RUSTFLAGS: -D warnings
9+
CARGO_TERM_COLOR: always
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
name: fuzz
16+
jobs:
17+
all:
18+
# Skip the Fuzzing Jobs until we make them run fast and reliably. Currently they will
19+
# always recompile the codebase for each test and that takes way too long.
20+
if: false
21+
22+
# Pin to `20.04` instead of `ubuntu-latest`, until ubuntu-latest migration is complete
23+
# See also <https://github.com/foundry-rs/foundry/issues/3827>
24+
runs-on: ubuntu-20.04
25+
strategy:
26+
matrix:
27+
target:
28+
- reth-primitives
29+
- reth-db
30+
- reth-eth-wire
31+
- reth-codecs
32+
steps:
33+
- name: Checkout sources
34+
uses: actions/checkout@v3
35+
- name: Install toolchain
36+
uses: dtolnay/rust-toolchain@stable
37+
with:
38+
components: llvm-tools-preview
39+
- uses: Swatinem/rust-cache@v2
40+
with:
41+
cache-on-failure: true
42+
43+
- name: Install fuzzer
44+
uses: actions-rs/cargo@v1
45+
with:
46+
command: install
47+
args: cargo-test-fuzz afl
48+
- name: Force install cargo-afl
49+
run: |
50+
cargo install --force afl
51+
cargo afl --version
52+
- name: Install cargo-llvm-cov
53+
uses: taiki-e/install-action@cargo-llvm-cov
54+
55+
- name: Run fuzz tests
56+
run: |
57+
./.github/scripts/fuzz.sh ${{ matrix.target }}
58+
env:
59+
AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES: 1
60+
- name: Upload coverage data to codecov
61+
uses: codecov/codecov-action@v3
62+
with:
63+
token: ${{ secrets.CODECOV_TOKEN }}
64+
files: lcov.info
65+
flags: fuzz-tests

0 commit comments

Comments
 (0)