-
-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (56 loc) · 1.44 KB
/
ci.yml
File metadata and controls
59 lines (56 loc) · 1.44 KB
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
on:
push:
branches:
- main
pull_request:
branches:
- main
name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Lint (clippy)
run: cargo clippy --all-features --all-targets
- name: Lint (rustfmt)
run: cargo xfmt --check
- name: Install cargo readme
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-readme
- name: Run cargo readme
run: ./scripts/regenerate-readmes.sh
- name: Check for differences
run: git diff --exit-code
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
# 1.34 is the MSRV
rust-version: [ 1.34, stable ]
fail-fast: false
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-version }}
- uses: Swatinem/rust-cache@v2
- name: Use pinned Cargo.lock for Rust 1.34
if: ${{ matrix.rust-version == 1.34 }}
run: cp Cargo.lock.rust134 Cargo.lock
- name: Build
run: cargo build --all-features
- name: Test
run: cargo test --all-features