-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (96 loc) · 3.45 KB
/
Copy pathci.yml
File metadata and controls
111 lines (96 loc) · 3.45 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
name: CI
# Deliberately narrow: only the checks that are deterministic and that were verified
# green locally before this file existed. A red badge is worse than no badge, so the
# workflow does not attempt the Next.js production build — that step copies submission
# artifacts out of docs/ and is better exercised by a real deploy than by a runner.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
contracts:
name: Contracts — build, test, coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: foundry-rs/foundry-toolchain@v1
- name: Build
run: forge build --sizes
- name: Test
run: forge test -vv
- name: Coverage
run: |
forge coverage --no-match-coverage "(script|test)" --report summary \
| tee coverage.txt
echo '### Solidity coverage' >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
grep -E '^\| (File|src/|Total)' coverage.txt >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
- name: Gas
run: |
forge test --gas-report > gas.txt 2>&1 || true
echo '### Gas' >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
sed -n '/ReceivableNote/,/^$/p' gas.txt | head -30 >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
analysis:
name: Contracts — static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: foundry-rs/foundry-toolchain@v1
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install slither-analyzer==0.11.6
# Reports, does not gate. Every finding is triaged in docs/STATIC-ANALYSIS.md, and
# most of them sit inside Sourcify-verified source that cannot be edited without
# breaking the deployed-bytecode match — so failing the build on a count nobody is
# allowed to change would only teach everyone to ignore a red badge.
- name: Slither
run: |
slither . --exclude-dependencies > slither.txt 2>&1 || true
echo '### Slither' >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
tail -1 slither.txt >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
echo 'Triage: docs/STATIC-ANALYSIS.md' >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@v4
with:
name: slither-report
path: slither.txt
dashboard:
name: Dashboard — types and lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: dashboard/package-lock.json
- run: npm ci
working-directory: dashboard
- run: npx tsc --noEmit
working-directory: dashboard
- run: npx eslint .
working-directory: dashboard
relayer:
name: Relayer — types
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: relayer/package-lock.json
- run: npm ci
working-directory: relayer
- run: npx tsc --noEmit
working-directory: relayer