-
Notifications
You must be signed in to change notification settings - Fork 19
117 lines (108 loc) · 3.17 KB
/
Copy pathci.yml
File metadata and controls
117 lines (108 loc) · 3.17 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
name: Utility-Protocol CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
rustfmt:
name: Rust formatting
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Restore Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: utility-protocol-ci
- name: Check formatting
run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Restore Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: utility-protocol-ci
- name: Run clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
test:
name: Rust tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Restore Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: utility-protocol-ci
- name: Run tests
run: cargo test --workspace --all-features
wasm:
name: WASM build
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Restore Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: utility-protocol-ci
- name: Build WASM artifacts
run: cargo build --manifest-path contracts/Cargo.toml --workspace --target wasm32-unknown-unknown --release
- name: Upload WASM artifacts
uses: actions/upload-artifact@v4
with:
name: wasm-artifacts
path: contracts/target/wasm32-unknown-unknown/release/*.wasm
if-no-files-found: error
fuzz-detection:
name: Fuzz infrastructure detection
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Restore Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: utility-protocol-ci
- name: Verify fuzz testing infrastructure
run: |
if [ -d "contracts/utility_contracts/fuzz" ]; then
cargo install cargo-fuzz --locked
cargo fuzz --version
echo "✅ Fuzz testing infrastructure available"
else
echo "ℹ️ No fuzz tests found"
fi