-
Notifications
You must be signed in to change notification settings - Fork 30
60 lines (53 loc) · 1.56 KB
/
Copy pathverify-build.yml
File metadata and controls
60 lines (53 loc) · 1.56 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
name: Verify Build
on:
push:
branches:
- main
- develop
- testnet
paths:
- 'contracts/**'
- '.github/workflows/verify-build.yml'
# Use pull_request (not pull_request_target): the check must run the workflow
# from the PR head so branch-filter changes take effect on the PR itself, and
# the build/test job needs no secrets, so the pull_request_target foot-gun
# (secrets + write token against PR head code) is avoided.
pull_request:
branches:
- main
- develop
- testnet
paths:
- 'contracts/**'
- '.github/workflows/verify-build.yml'
- '.github/workflows/rustfmt.yml'
workflow_dispatch:
permissions:
contents: read
actions: read
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4
- name: Setup Rust and Stellar
uses: ./.github/actions/setup-rust-stellar
- name: Build events contract
run: cd contracts/events && make build
- name: Build profile contract
run: cd contracts/profile && make build
- name: Check WASM sizes (64 KB ceiling)
run: |
for f in target/wasm32v1-none/release/*.wasm; do
size=$(stat -c%s "$f")
name=$(basename "$f")
echo "$name: $size bytes"
if [ "$size" -gt 65536 ]; then
echo "::error::$name exceeds 64 KB ceiling ($size bytes)"
exit 1
fi
done
- name: Run tests
run: cargo test --release