-
Notifications
You must be signed in to change notification settings - Fork 49
91 lines (89 loc) · 2.56 KB
/
continuous-integration.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
on:
push:
branches: [ master ]
pull_request:
name: Continuous integration
jobs:
check:
name: Check
runs-on: ${{ matrix.os }}
strategy:
matrix:
build_name: [windows, ubuntu, macos-x86, macos-aarch64]
include:
- build_name: windows
os: windows-latest
target: x86_64-pc-windows-msvc
- build_name: ubuntu
os: ubuntu-latest
target: x86_64-unknown-linux-musl
- build_name: macos-x86
os: macos-latest
target: x86_64-apple-darwin
- build_name: macos-aarch64
os: macos-latest
target: aarch64-apple-darwin
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Update Rust
run: |
rustup update
rustup target add ${{ matrix.target }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- run: cargo check --verbose --locked --target ${{ matrix.target }}
check-readme:
name: Check README
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update Rust
run: rustup update
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- run: cargo build --verbose --locked
- name: Check README help message
run: "[[ ! $(comm -13 <(sort README.md) <(cargo run --locked -- --help | sort)) ]] || cargo run --locked -- --help | diff - README.md"
check-publish:
name: Check cargo publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update Rust
run: rustup update
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- run: cargo publish --dry-run --verbose --locked
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update Rust
run: rustup update
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- run: cargo test
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update Rust
run: rustup update
- run: rustup component add rustfmt
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update Rust
run: rustup update
- run: rustup component add clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- run: cargo clippy -- -D warnings