forked from eth-act/zkevm-benchmark-workload
-
Notifications
You must be signed in to change notification settings - Fork 1
115 lines (99 loc) · 3.37 KB
/
rust-checks.yml
File metadata and controls
115 lines (99 loc) · 3.37 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
name: Rust Checks
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
check-scripts:
name: Check bash scripts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download and Extract Fixtures
run: |
chmod +x ./scripts/download-and-extract-fixtures.sh
./scripts/download-and-extract-fixtures.sh v5.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
check-precompile-patches:
name: Check ${{ matrix.zkVM }} unused precompile patches
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- zkVM: reth-sp1-stateless-validator
xtask: sp1
- zkVM: reth-risc0-stateless-validator
xtask: risc0
- zkVM: reth-zisk-stateless-validator
xtask: zisk
- zkVM: reth-pico-stateless-validator
xtask: pico
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # stable
with:
toolchain: stable
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: ere-guests
- name: Check for unused [patch] entries
shell: bash
run: |
set -euo pipefail
cargo ${{ matrix.xtask }}
cd ere-guests
if cargo tree -p ${{ matrix.zkVM }} 2>&1 | grep -F "was not used in the crate graph"; then
exit 1
fi
lint-and-test:
name: Lint and Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install protoc
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@881ba7bf39a41cda34ac9e123fb41b44ed08232f # nightly
with:
toolchain: nightly
components: clippy, rustfmt
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --check --all
- name: Check clippy
run: cargo clippy --workspace --bins --lib --examples --tests --benches --all-features -- -D warnings
- name: Run all tests except integration tests
env:
RPC_URL: ${{ secrets.RPC_URL }}
RPC_HEADERS: ${{ secrets.RPC_HEADERS }}
run: cargo test --release --workspace --exclude integration-tests -- --no-capture
check-empty-patch-crates-io:
name: Check [patch.crates-io] is empty
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check patch.crates-io is empty in ere-guests/Cargo.toml
run: |
# Extract lines between [patch.crates-io] and the next section
# Fail if there are non-empty, non-comment lines
sed -n '/^\[patch\.crates-io\]/,/^\[/p' ere-guests/Cargo.toml | \
sed '1d;$d' | \
grep -v '^[[:space:]]*#' | \
grep -v '^[[:space:]]*$' && \
{ echo "ERROR: [patch.crates-io] section in ere-guests/Cargo.toml must be empty"; exit 1; } || \
echo "✓ [patch.crates-io] section is empty"