forked from Hub-of-Evolution/CraftNexus
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.77 KB
/
Copy pathci.yml
File metadata and controls
60 lines (50 loc) · 1.77 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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-git-
- name: Cache cargo build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-target-
# Host target: crate .cargo/config.toml historically defaulted to wasm32,
# and wasm LTO rustflags break `cargo check --tests` (embed-bitcode=no vs LTO).
- name: Check code
working-directory: craft-nexus-contract
run: cargo check --tests --target x86_64-unknown-linux-gnu
- name: Run clippy
working-directory: craft-nexus-contract
run: cargo clippy --target x86_64-unknown-linux-gnu -- -D warnings
- name: Run tests
working-directory: craft-nexus-contract
run: cargo test --release --target x86_64-unknown-linux-gnu
- name: Build WASM
working-directory: craft-nexus-contract
run: cargo build --target wasm32-unknown-unknown --release