-
Notifications
You must be signed in to change notification settings - Fork 59
86 lines (84 loc) · 2.16 KB
/
rust.yml
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
name: Rust check/build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
ARCH: x86_64-unknown-linux-gnu
jobs:
build:
runs-on: ${{ matrix.os }}
env:
RUST_BACKTRACE: 1
strategy:
matrix:
# build: [ubuntu64, win64]
build: [ubuntu64]
include:
- build: ubuntu64
os: ubuntu-latest
host_target: x86_64-unknown-linux-gnu
# - build: win64
# os: windows-latest
# host_target: x86_64-pc-windows-msvc
steps:
# Checkout source code
- uses: actions/checkout@v3
# Cleanup Disk
- name: Cleanup Disk
if: matrix.os == 'ubuntu-latest'
run: |
df -h;
sudo rm -rf /usr/local/lib/android;
sudo rm -rf /usr/share/dotnet;
df -h
# Setup rust toolchain
- name: Setup rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
components: clippy
# Setup wasm32-wasi toolchain
- name: setup wasm32-wasi toolchain
run: rustup target add wasm32-wasi
# Should help bring down build times
- uses: Swatinem/rust-cache@v1
with:
key: "1" # increment this to bust the cache if needed
- name: Install tauri system deps
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update -y
make setup-dev-linux
make setup-dev
- name: Build crates
uses: actions-rs/cargo@v1
with:
command: build
args: --all
# Run tests
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all
# Run clippy
- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
# make sure we ran fmt
- name: run fmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --check
# Run spyglass backend in check mode to validate migrations & other basic startup
# procedures.
- name: run spyglass checks
run: cargo run -p spyglass -- --check