-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.39 KB
/
rust-ci.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
name: Rust CI
on:
push:
branches: master
pull_request:
branches: master
schedule:
- cron: "0 0 1 * *" # monthly
workflow_dispatch: # allow manual triggering of the action
env:
RUSTFLAGS: "-Dwarnings"
jobs:
build-crate:
name: Build and test crate/docs
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
toolchain: [nightly, beta, stable]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rust-docs
- name: Build library
run: cargo build -v --lib --no-default-features
- name: Build binary
run: cargo build -v --bins
- name: Library tests
run: cargo test --no-default-features --lib
- name: Doc tests
run: cargo test --doc --no-default-features
- name: Build docs
run: cargo doc --no-deps --no-default-features
clippy-rustfmt:
name: Clippy and rustfmt
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: clippy
run: cargo clippy
continue-on-error: true
- name: rustfmt
run: cargo fmt -- --check
continue-on-error: true