-
Notifications
You must be signed in to change notification settings - Fork 59
67 lines (56 loc) · 1.97 KB
/
Copy pathci.yml
File metadata and controls
67 lines (56 loc) · 1.97 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
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test-and-build:
name: Test and build WASM
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32v1-none
components: rustfmt, clippy
- name: Cache cargo registry and build output
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
soroban/target
key: ${{ runner.os }}-cargo-${{ hashFiles('soroban/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build WASM fixtures for factory integration tests
working-directory: soroban
run: cargo build --workspace --target wasm32v1-none --release
- name: Check formatting
working-directory: soroban
run: cargo fmt --all -- --check
- name: Clippy
working-directory: soroban
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Pre-build farming-pool WASM for integration tests
working-directory: soroban
# `factory/src/test.rs` embeds the real farming-pool WASM via
# `farming_pool::WASM` (soroban_sdk::contractfile!). That macro
# requires the compiled `.wasm` artifact to exist before `cargo test`
# can compile the factory crate's test binary.
run: cargo build -p farming-pool --target wasm32v1-none --release
- name: Run tests
working-directory: soroban
run: cargo test --workspace
- name: Build release WASM
working-directory: soroban
run: cargo build --target wasm32v1-none --release
- name: Upload WASM artifacts
uses: actions/upload-artifact@v7
with:
name: wasm-${{ github.sha }}
path: soroban/target/wasm32v1-none/release/*.wasm
if-no-files-found: error