-
Notifications
You must be signed in to change notification settings - Fork 19
139 lines (115 loc) · 3.64 KB
/
pr.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
name: "PR"
on:
push:
branches:
- "main"
pull_request:
concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true
jobs:
lock-files:
name: "Check lock files"
runs-on: ["runs-on", "runner=8cpu-linux-x64", "run-id=${{ github.run_id }}"]
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: "Checkout sources"
uses: "actions/checkout@v4"
- name: "Update lock files"
run: |
cargo tree
(cd ./bin/client-eth && cargo tree)
(cd ./bin/client-op && cargo tree)
(cd ./bin/client-linea && cargo tree)
- name: "Assert no changes"
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Lock files not up to date"
exit 1
fi
deps-semver:
name: "Check upstream SemVer violations"
runs-on: ["runs-on", "runner=8cpu-linux-x64", "run-id=${{ github.run_id }}"]
steps:
- name: "Checkout sources"
uses: "actions/checkout@v4"
- name: "Install sp1up"
run: |
curl -L https://sp1.succinct.xyz | bash
echo "$HOME/.sp1/bin" >> $GITHUB_PATH
- name: "Install SP1 toolchain"
run: |
sp1up
- name: "Remove lock files"
run: |
find -name Cargo.lock -type f -exec rm {} \;
- name: "Build without lock files"
run: |
cargo build --all --all-targets
fmt:
name: "Check code format"
runs-on: ["runs-on", "runner=8cpu-linux-x64", "run-id=${{ github.run_id }}"]
steps:
- name: "Checkout sources"
uses: "actions/checkout@v4"
- name: "Setup nightly toolchain"
uses: "actions-rs/toolchain@v1"
with:
toolchain: "nightly"
profile: "minimal"
components: "rustfmt"
override: true
- name: "Check Rust format"
run: |
cargo fmt --all -- --check
clippy:
name: "Run clippy lints"
runs-on: ["runs-on", "runner=8cpu-linux-x64", "run-id=${{ github.run_id }}"]
steps:
- name: "Checkout sources"
uses: "actions/checkout@v4"
- name: "Install sp1up"
run: |
curl -L https://sp1.succinct.xyz | bash
echo "$HOME/.sp1/bin" >> $GITHUB_PATH
- name: "Install SP1 toolchain"
run: |
sp1up
# This step is necessary to generate the ELF files.
- name: "Build"
run: |
cargo build --all --all-targets
- name: "Run clippy lints"
run: |
cargo clippy --all --all-targets -- -D warnings
tests:
name: "Run tests"
runs-on:
["runs-on", "runner=64cpu-linux-x64", "run-id=${{ github.run_id }}"]
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: "Checkout sources"
uses: "actions/checkout@v4"
- name: "Install sp1up"
run: |
curl -L https://sp1.succinct.xyz | bash
echo "$HOME/.sp1/bin" >> $GITHUB_PATH
- name: "Install SP1 toolchain"
run: |
sp1up
- name: "Set up test fixture"
run: |
git clone https://github.com/succinctlabs/rsp-tests --branch 2024-09-11 --depth 1 ../rsp-tests
cd ../rsp-tests/
docker compose up -d
- name: "Use local test fixture"
run: |
echo "RPC_1=http://localhost:9545/main/evm/1" >> $GITHUB_ENV
echo "RPC_10=http://localhost:9545/main/evm/10" >> $GITHUB_ENV
echo "RPC_59144=http://localhost:9545/main/evm/59144" >> $GITHUB_ENV
- name: "Run tests"
run: |
export RUST_LOG=info
cargo test --all -- --nocapture