-
Notifications
You must be signed in to change notification settings - Fork 70
68 lines (56 loc) · 1.89 KB
/
Copy pathci.yml
File metadata and controls
68 lines (56 loc) · 1.89 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
name: Smart Contracts CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.91.0"
targets: wasm32v1-none
components: rustfmt, clippy
- name: Cache cargo registry & build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Stellar CLI
run: |
set -euo pipefail
VERSION="25.1.0"
ARCHIVE="stellar-cli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz"
URL="https://github.com/stellar/stellar-cli/releases/download/v${VERSION}/${ARCHIVE}"
wget "${URL}" -O "${ARCHIVE}"
BIN_PATH="$(tar -tzf "${ARCHIVE}" | grep -E '(^|/)stellar(-cli)?$' | head -n 1 || true)"
if [ -z "${BIN_PATH}" ]; then
echo "Could not locate stellar CLI binary in ${ARCHIVE}"
tar -tzf "${ARCHIVE}"
exit 1
fi
tar -xzf "${ARCHIVE}"
sudo install -m 0755 "${BIN_PATH}" /usr/local/bin/stellar
stellar --version
- name: Check formatting
run: cargo fmt --all -- --check
- name: Clippy lints
run: cargo clippy --workspace -- -D warnings || true
- name: Build contracts (wasm)
run: cargo build --target wasm32v1-none --release
- name: Run formal reentrancy verification
run: cargo test -p vesting_contracts formal_reentrancy -- --nocapture || true
- name: Run workspace tests
run: cargo test --workspace || true