-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (49 loc) · 1.12 KB
/
build.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
name: Build
on:
workflow_dispatch:
push:
branches: [ "main" ]
paths:
- "src/**"
- "tests/**"
- "examples/**"
- "Cargo.toml"
pull_request:
paths:
- "src/**"
- "tests/**"
- "examples/**"
- "Cargo.toml"
env:
TOOLCHAIN: nightly-2023-10-07
jobs:
build:
name: Build & Test
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.TOOLCHAIN }}
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
key: ${{ env.TOOLCHAIN }}
- name: Compile
run: cargo build --release --verbose
- name: Test
run: cargo test --verbose
rustfmt:
name: Check Formatting
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.TOOLCHAIN }}
components: rustfmt
- run: cargo fmt --all --check