-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (52 loc) · 1.48 KB
/
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
name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
rust:
name: Test
strategy:
matrix:
rust:
- stable
- '1.70'
include:
- rust: stable
extra_components: rustfmt
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
components: ${{ matrix.extra_components }}
- name: Test with all features
run: cargo test --all-features --all-targets
- name: Compile with no features
run: cargo check --no-default-features
- name: Check fuzz tests compile (but don't actually fuzz)
run: cd fuzz && cargo check && cargo test
- name: Check main crate formatting
if: matrix.rust == 'stable'
run: cargo fmt -- --check
- name: Check fuzz crate formatting
if: matrix.rust == 'stable'
run: cd fuzz && cargo fmt -- --check
license:
name: Check copyright/license headers
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- run: find . -name target -prune -o -type f -print0 | xargs -0 .github/workflows/check-license.py