forked from BartSimpson2911/CoTask
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.42 KB
/
Copy pathrust-ci.yml
File metadata and controls
57 lines (46 loc) · 1.42 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
name: COTASK CI pipeline
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
# 1️⃣ Checkout repository
- name: Checkout Code
uses: actions/checkout@v4
# 2️⃣ Setup Rust toolchain (official)
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
targets: wasm32-unknown-unknown
# 3️⃣ Cache Cargo dependencies + build output
- name: Cache Cargo registry + build
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# 4️⃣ Install wasm-pack (if your x.sh uses it)
- name: Install wasm-pack
run: cargo install wasm-pack --locked
# 5️⃣ Lint check (fail if warnings)
- name: Clippy Lint
run: cargo clippy --all-targets --all-features -- -D warnings
# 6️⃣ Format enforcement
- name: Rustfmt Check
run: cargo fmt --all -- --check
# 7️⃣ Run tests
- name: Run Tests
run: cargo test --all-features
# 8️⃣ Make x.sh executable
- name: Make script executable
run: chmod +x x.sh
# 9️⃣ Build using your custom script
- name: Build Project
run: bash ./x.sh build