-
Notifications
You must be signed in to change notification settings - Fork 9
55 lines (51 loc) · 1.5 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: Test library (palette feature)
run: cargo test --no-default-features --lib --features palette_color
- name: Doc tests (palette feature)
run: cargo test --no-default-features --doc --features palette_color
- name: Build docs
run: cargo doc --no-deps --no-default-features --features palette_color
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