-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (59 loc) · 2.17 KB
/
Copy pathcontract-tests.yml
File metadata and controls
70 lines (59 loc) · 2.17 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
name: Contract Tests
on:
push:
branches: [main, next]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
forge-test:
if: >
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
name: forge-test
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Reset workspace to HEAD
run: git checkout HEAD -- .
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install contract dependencies
working-directory: lit-api-server/blockchain/lit_node_express
run: npm ci
- name: Check Foundry toolchain
id: foundry-toolchain
run: |
# The global install on the shared runner lives in ~/.foundry/bin, which
# is only on PATH via the user's shell profile. GH Actions steps run in a
# non-login shell that doesn't source it, so probe the known location too.
forge_bin="$(command -v forge || true)"
if [ -z "$forge_bin" ] && [ -x "$HOME/.foundry/bin/forge" ]; then
forge_bin="$HOME/.foundry/bin/forge"
fi
if [ -n "$forge_bin" ] && "$forge_bin" --version | grep -Eq '(^|[^0-9])1\.5\.1([^0-9]|$)'; then
"$forge_bin" --version
# Put it on PATH for later steps so they don't trigger a reinstall.
echo "$(dirname "$forge_bin")" >> "$GITHUB_PATH"
echo "installed=true" >> "$GITHUB_OUTPUT"
else
echo "installed=false" >> "$GITHUB_OUTPUT"
fi
- name: Install Foundry
if: steps.foundry-toolchain.outputs.installed != 'true'
uses: foundry-rs/foundry-toolchain@v1
with:
# Pinned for reproducibility. Bump intentionally when upgrading.
version: v1.5.1
- name: Build contracts
working-directory: lit-api-server/blockchain/lit_node_express
run: forge build --sizes
- name: Run forge tests
working-directory: lit-api-server/blockchain/lit_node_express
run: forge test -vv