Repository navigation
133 lines (124 loc) · 4.38 KB
/
Copy pathtest.yml
File metadata and controls
133 lines (124 loc) · 4.38 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
# 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
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:
contents: read
needs: matrices
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrices.outputs.test-matrix) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
with:
toolchain: stable
target: ${{ matrix.target }}
- uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1
- uses: taiki-e/install-action@a6b2e2dcd845ddd7f509ce4f3ed3d922b80cc5d9 # v2.84.0
with:
tool: nextest
# 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: 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: 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 }}-
- uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- 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 }}
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 "${args[@]}"