-
Notifications
You must be signed in to change notification settings - Fork 1
116 lines (110 loc) · 3.84 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Format check
run: cargo fmt --check
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
- name: Clippy
run: cargo clippy -- --deny warnings
build:
name: build (${{ matrix.job.target }})
runs-on: ${{ matrix.job.os }}
strategy:
fail-fast: false
matrix:
job:
- { target: aarch64-apple-darwin, os: macos-latest }
# - { target: aarch64-pc-windows-gnu, os: ubuntu-latest }
# - { target: aarch64-pc-windows-msvc, os: windows-latest }
- { target: aarch64-unknown-linux-gnu, os: ubuntu-latest }
- { target: aarch64-unknown-linux-musl, os: ubuntu-latest }
# - { target: arm-unknown-linux-gnueabi, os: ubuntu-latest }
# - { target: arm-unknown-linux-gnueabihf, os: ubuntu-latest }
# - { target: arm-unknown-linux-musleabi, os: ubuntu-latest }
# - { target: arm-unknown-linux-musleabihf, os: ubuntu-latest }
- { target: armv7-unknown-linux-gnueabi, os: ubuntu-latest }
- { target: armv7-unknown-linux-gnueabihf, os: ubuntu-latest }
- { target: armv7-unknown-linux-musleabi, os: ubuntu-latest }
- { target: armv7-unknown-linux-musleabihf, os: ubuntu-latest }
# - { target: i686-pc-windows-gnu, os: ubuntu-latest }
# - { target: i686-pc-windows-msvc, os: windows-latest }
# - { target: i686-unknown-linux-gnu, os: ubuntu-latest }
# - { target: i686-unknown-linux-musl, os: ubuntu-latest }
- { target: x86_64-apple-darwin, os: macos-latest }
- { target: x86_64-pc-windows-gnu, os: ubuntu-latest }
- { target: x86_64-pc-windows-msvc, os: windows-latest }
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
- { target: x86_64-unknown-linux-musl, os: ubuntu-latest }
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.job.target }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.job.target }}
- name: Install cross
run: cargo install --force cross
if: runner.os == 'Linux'
- name: Build
run: cargo build --locked --release --target=${{ matrix.job.target }}
if: runner.os != 'Linux'
- name: Build (cross)
run: cross build --locked --release --target=${{ matrix.job.target }}
if: runner.os == 'Linux'
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
- name: Test
run: cargo test --all-targets --all-features
audit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Audit
run: cargo audit