Repository navigation
185 lines (176 loc) · 6.76 KB
/
Copy pathtest.yml
File metadata and controls
185 lines (176 loc) · 6.76 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
# Reusable workflow for running tests via `cargo nextest`
name: test
permissions: {}
on:
workflow_call:
inputs:
profile:
required: true
type: string
secrets:
ETHERSCAN_API_KEY:
required: false
ARBITRUM_RPC:
required: false
ETH_SEPOLIA_RPC:
required: false
TEMPO_MAINNET_RPC_URL:
required: false
TEMPO_TESTNET_RPC_URL:
required: false
concurrency:
group: tests-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTC_WRAPPER: "sccache"
RUST_MIN_STACK: 4194304 # 2 * the default (2 * 1024 * 1024)
jobs:
matrices:
name: build matrices
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
test-matrix: ${{ steps.gen.outputs.test-matrix }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
- name: Generate matrices
id: gen
env:
EVENT_NAME: ${{ github.event_name }}
PROFILE: ${{ inputs.profile }}
shell: bash
run: |
output=$(python3 .github/scripts/matrices.py)
printf '::debug::test-matrix=%s\n' "$output"
printf 'test-matrix=%s\n' "$output" >> "$GITHUB_OUTPUT"
test:
name: test ${{ matrix.name }}
runs-on: ${{ matrix.runner_label }}
timeout-minutes: 60
permissions:
id-token: write
contents: read
needs: matrices
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrices.outputs.test-matrix) }}
steps:
- name: Secure runner
uses: tempoxyz/gh-actions/actions/secure-runner@d5402286a7abdfb7232173b3228d56473feb8a66
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067 # v1
with:
toolchain: stable
target: ${{ matrix.target }}
- uses: rui314/setup-mold@10ca16bf91dc22e05ebdc935cad9c75ea248f621 # v1
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install --yes libudev-dev
- name: Check out LCOV
if: runner.os == 'Linux' && !contains(matrix.name, 'external')
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: linux-test-project/lcov
ref: 5186f7394417292537d17b9a9a30f8c06bedc16c # v2.3.1
path: .lcov
persist-credentials: false
- name: Set up LCOV report validation
if: runner.os == 'Linux' && !contains(matrix.name, 'external')
run: |
sudo apt-get install --yes libcapture-tiny-perl libdatetime-perl libtimedate-perl
echo "FOUNDRY_TEST_GENHTML=$GITHUB_WORKSPACE/.lcov/bin/genhtml" >> "$GITHUB_ENV"
.lcov/bin/genhtml --version
# External tests dependencies
- name: Setup Node.js
if: contains(matrix.name, 'external')
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
- name: Install Bun
if: contains(matrix.name, 'external')
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- name: Install pnpm for external fixtures
if: contains(matrix.name, 'external')
uses: tempoxyz/gh-actions/vendor/pnpm/action-setup@d5402286a7abdfb7232173b3228d56473feb8a66
with:
version: 11.8.0
run_install: false
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"
- name: Install Vyper
# Also update vyper version in .devcontainer/Dockerfile.dev
run: pip --version && pip install vyper==0.4.3
- name: Install Z3
# Pinned so the `forge test --symbolic` snapshot tests stay stable across solver versions.
if: runner.os == 'Linux'
run: pip install z3-solver==5.1.0.0 && z3 --version
- name: Foundry test cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.foundry/cache
~/.config/.foundry/cache
testdata/cache
testdata/out
# Use a unique key for each run to always update the cache.
key: ${{ runner.os }}-foundry-${{ matrix.name }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-foundry-${{ matrix.name }}-
- name: Seed signatures used by trace snapshots
shell: bash
run: |
python3 - <<'PYTHON'
import json
from pathlib import Path
path = Path.home() / ".foundry/cache/signatures"
cache = json.loads(path.read_text()) if path.exists() else {}
fixtures = json.loads(Path("testdata/fixtures/trace-signatures.json").read_text())
for kind, signatures in fixtures.items():
cache.setdefault(kind, {}).update(signatures)
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(json.dumps(cache))
PYTHON
- uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
cache-bin: false
- uses: taiki-e/install-action@dfae9bf3d6f6c6f20ef4ebb3486c01a51341ff12 # v2.87.18
with:
tool: nextest
- name: Setup Git config
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
git config --global url."https://github.com/".insteadOf "git@github.com:"
- name: Test
env:
SVM_TARGET_PLATFORM: ${{ matrix.svm_target_platform }}
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
ARBITRUM_RPC: ${{ secrets.ARBITRUM_RPC }}
ETH_SEPOLIA_RPC: ${{ secrets.ETH_SEPOLIA_RPC }}
TEMPO_MAINNET_RPC_URL: ${{ secrets.TEMPO_MAINNET_RPC_URL }}
TEMPO_TESTNET_RPC_URL: ${{ secrets.TEMPO_TESTNET_RPC_URL }}
NEXTEST_FILTER: ${{ matrix.filter }}
NEXTEST_PARTITION: ${{ matrix.partition_arg }}
shell: bash
run: |
args=(-E "$NEXTEST_FILTER")
if [[ -n "$NEXTEST_PARTITION" ]]; then
args+=(--partition "$NEXTEST_PARTITION")
fi
args+=(--no-fail-fast)
cargo nextest run --locked --features base,monad "${args[@]}"