forked from scottlamb/retina
-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (60 loc) · 1.71 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
55
56
57
58
59
60
61
62
63
name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
rust:
name: Test
strategy:
matrix:
rust:
- stable
- 1.67
include:
- rust: stable
extra_components: rustfmt
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: ${{ matrix.extra_components }}
- name: Build
run: cargo build --all-features --all-targets --workspace
- name: Test
run: cargo test --all-features --all-targets --workspace
- name: Check fuzz tests
run: cd fuzz && cargo check --workspace
- name: Check main workspace formatting
if: matrix.rust == 'stable'
run: cargo fmt --all --check
- name: Check fuzz worspace formatting
if: matrix.rust == 'stable'
run: cd fuzz && cargo fmt --all --check
- name: Clippy on main workspace
if: matrix.rust == 'stable'
run: cargo clippy --workspace -- -D warnings
- name: Clippy on fuzz workspace
if: matrix.rust == 'stable'
run: cd fuzz && cargo clippy --workspace -- -D warnings
license:
name: Check copyright/license headers
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- run: find . -type f -print0 | xargs -0 .github/workflows/check-license.py