forked from foundry-rs/foundry
-
Notifications
You must be signed in to change notification settings - Fork 1
119 lines (110 loc) · 3.75 KB
/
test.yml
File metadata and controls
119 lines (110 loc) · 3.75 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
# Reusable workflow for running tests via `cargo nextest`
name: test
permissions: {}
on:
workflow_call:
inputs:
profile:
required: true
type: string
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@v6
with:
persist-credentials: false
- uses: actions/setup-python@v6
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@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: stable
target: ${{ matrix.target }}
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: taiki-e/install-action@4c6723ec9c638cccae824b8957c5085b695c8085 # v2
with:
tool: nextest
# External tests dependencies
- name: Setup Node.js
if: contains(matrix.name, 'external')
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install Bun
if: contains(matrix.name, 'external')
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2
with:
bun-version: latest
- name: Setup Python
uses: actions/setup-python@v6
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@v5
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@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
- 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 }}
HTTP_ARCHIVE_URLS: ${{ secrets.HTTP_ARCHIVE_URLS }}
WS_ARCHIVE_URLS: ${{ secrets.WS_ARCHIVE_URLS }}
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
ARBITRUM_RPC: ${{ secrets.ARBITRUM_RPC }}
ETH_SEPOLIA_RPC: ${{ secrets.ETH_SEPOLIA_RPC }}
run: cargo nextest run ${{ matrix.flags }}