-
Notifications
You must be signed in to change notification settings - Fork 55
181 lines (166 loc) · 5.54 KB
/
Copy pathci.yml
File metadata and controls
181 lines (166 loc) · 5.54 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
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
- cron: '23 4 * * *'
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
evm: ${{ steps.filter.outputs.evm }}
stellar: ${{ steps.filter.outputs.stellar }}
solana: ${{ steps.filter.outputs.solana }}
ckb: ${{ steps.filter.outputs.ckb }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
evm:
- 'evm/**'
stellar:
- 'stellar/**'
solana:
- 'solana/**'
ckb:
- 'ckb/**'
evm:
needs: changes
if: needs.changes.outputs.evm == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: evm
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npx prettier --check --ignore-path ../.prettierignore .
- run: npx hardhat compile
- run: npx hardhat test
stellar:
needs: changes
if: needs.changes.outputs.stellar == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: stellar
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Enable corepack (pins pnpm from packageManager field)
run: |
corepack enable
corepack prepare pnpm@10.28.2 --activate
pnpm --version
- name: Install Node dependencies
run: pnpm install
working-directory: .
- name: Setup Stellar CLI
env:
STELLAR_CLI_VERSION: 22.0.1
run: |
curl -sSL \
"https://github.com/stellar/stellar-cli/releases/download/v${STELLAR_CLI_VERSION}/stellar-cli-${STELLAR_CLI_VERSION}-x86_64-unknown-linux-gnu.tar.gz" \
| tar xz
sudo mv stellar /usr/local/bin/stellar
sudo ln -sf /usr/local/bin/stellar /usr/local/bin/soroban
stellar --version
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: rustfmt
- run: cargo fmt --all --check
- run: cargo test --workspace
# WASM build depends on soroban-sdk 22.0.11 compiling under current
# stable rustc, which fails with 162 unresolved-import errors in the
# SDK's transitive deps. This is a soroban-sdk 22.0.11 bug fixed in
# 23.x/27.x — bumping is a major API migration owned separately.
# Keep the step visible but non-blocking so it doesn't gate wave PRs.
- name: Build WASM (soroban-sdk 22 vs current rustc; non-blocking)
continue-on-error: true
run: cargo build --target wasm32-unknown-unknown --release
- name: Optimize and Check WASM Size
continue-on-error: true
run: |
if ! ls target/wasm32-unknown-unknown/release/*.wasm > /dev/null 2>&1; then
echo "No WASM artifacts (build step above did not produce output); skipping optimize."
exit 0
fi
for wasm in target/wasm32-unknown-unknown/release/*.wasm; do
soroban contract optimize --wasm "$wasm"
opt_wasm="${wasm%.*}_optimized.wasm"
SIZE=$(stat -c%s "$opt_wasm")
echo "$opt_wasm size is $SIZE bytes"
if [ "$SIZE" -gt 112640 ]; then
echo "Error: $opt_wasm exceeds 110 KB limit"
exit 1
fi
done
- name: Run Upgrade Authority Enforcement Tests
run: cargo test upgrade_auth --workspace
# Bindings depend on a successful workspace WASM build (currently
# non-blocking; see the note on the Build WASM step). Mark this
# non-blocking too so bindings-drift detection doesn't spuriously
# fail wave PRs.
- name: Generate Stellar TypeScript bindings
id: bindings
continue-on-error: true
run: pnpm bindings:stellar
working-directory: .
- name: Check for bindings drift (diff detection)
if: steps.bindings.outcome == 'success'
run: git diff --exit-code
working-directory: .
stellar-nightly:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
defaults:
run:
working-directory: stellar
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all --check
- run: WRAITH_PROPTEST_CASES=16384 cargo test --workspace --test properties
solana:
needs: changes
if: needs.changes.outputs.solana == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: solana
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.91.0
- uses: heyAyushh/setup-anchor@v4.2
with:
anchor-version: 0.30.1
- run: anchor build
ckb:
needs: changes
if: needs.changes.outputs.ckb == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ckb
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: riscv64imac-unknown-none-elf
- run: sudo apt-get update && sudo apt-get install -y gcc-riscv64-unknown-elf
- run: CC_riscv64imac_unknown_none_elf=riscv64-unknown-elf-gcc cargo build --target riscv64imac-unknown-none-elf --release -p wraith-stealth-lock