-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (72 loc) · 2.32 KB
/
rust.yaml
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
name: Rust Checks
run-name: "${{ github.ref }} by @${{ github.actor }}"
on:
push:
branches:
- master
- main
- staging
pull_request:
branches:
- master
- main
- staging
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
ubuntu-native:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Rust install
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh
sh ./rustup.sh --profile minimal -y
- name: Setup Cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/
target/
key: ${{ runner.os }}-native-${{ github.ref }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-native-
- name: Format
# https://github.com/rust-lang/rustfmt#checking-style-on-a-ci-server
run: cargo fmt --all -- --check
- name: Build
run: cargo build --release --features unit_control_wasm
- name: Clippy
run: cargo clippy --release --features unit_control_wasm -- --no-deps --deny "warnings"
- name: Test
run: cargo test --release --features unit_control_wasm
web-wasmpack:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./battleground_viewer
steps:
- uses: actions/checkout@v3
- name: Rust install
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh
sh ./rustup.sh --profile minimal -y -t wasm32-unknown-unknown
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Setup Cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/
target/
key: ${{ runner.os }}-web-${{ github.ref }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-web-
- name: Build
run: |
cat /home/runner/work/battleground_construct/battleground_construct/Cargo.toml
wasm-pack build --release --target web --out-name web
- name: Clippy
run: |
cargo clippy --release --target wasm32-unknown-unknown -- --no-deps --deny "warnings"