Repository navigation
110 lines (88 loc) · 3.07 KB
/
Copy pathci.yml
File metadata and controls
110 lines (88 loc) · 3.07 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
name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
contract:
name: Contract — test / fmt / clippy / wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32v1-none
components: rustfmt, clippy
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Format check
run: cargo fmt --all -- --check
- name: Clippy (deny warnings)
run: cargo clippy --all-targets -- -D warnings
- name: Unit + property tests
run: cargo test -p streampay-contract --locked
- name: Coverage
uses: taiki-e/install-action@cargo-llvm-cov
with:
tool: cargo-llvm-cov
- name: llvm-cov (summary)
run: cargo llvm-cov -p streampay-contract --summary-only
# soroban-sdk 28 rejects a plain `cargo build --target wasm32v1-none`
# (its build script requires the stellar-cli >= 25.2 spec-shaking v2
# handshake), so the supported build path is `stellar contract build`.
- name: Install stellar-cli
run: |
curl -fsSL https://github.com/stellar/stellar-cli/releases/download/v28.1.0/stellar-cli-28.1.0-x86_64-unknown-linux-gnu.tar.gz | tar xz
sudo install stellar /usr/local/bin/stellar
stellar --version
- name: Wasm build (stellar contract build)
working-directory: contracts/streaming-payments
run: stellar contract build
frontend:
name: Frontend — lint / typecheck / build / audit
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Typecheck
run: npm run typecheck
- name: Build
run: npm run build
- name: Dependency audit
# Production deps only: dev-tooling advisories (e.g. braces in the
# eslint chain) never ship to users and currently have no fix.
# High-severity prod advisories fail the build.
run: npm audit --omit=dev --audit-level=high
supply-chain:
name: Security — advisories / licenses
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# cargo-deny's advisories check covers the same RustSec database as
# cargo-audit, so one gate owns the ignore policy (see deny.toml).
- name: cargo-deny (advisories, licenses, bans, sources)
uses: EmbarkStudios/cargo-deny-action@v2