-
Notifications
You must be signed in to change notification settings - Fork 3
96 lines (89 loc) · 2.42 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
name: Rust CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
build-test-native:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
target: [
x86_64-unknown-linux-gnu,
x86_64-unknown-linux-musl,
aarch64-apple-darwin,
x86_64-pc-windows-msvc,
i686-pc-windows-msvc,
]
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: i686-pc-windows-msvc
os: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install corresponding target
run: rustup target add ${{ matrix.target }}
- name: Build all features
run: cargo build --verbose --all-features --target ${{ matrix.target }}
- name: Run tests
run: cargo test --verbose --target ${{ matrix.target }} -- --test-threads=1
cross:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [
i686-unknown-linux-gnu,
aarch64-unknown-linux-gnu,
]
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set up cross
run: cargo install cross
- name: Build all features
run: cross build --verbose --all-features --target ${{ matrix.target }}
- name: Run tests
run: cross test --verbose --target ${{ matrix.target }} -- --test-threads=1
rustfmt:
name: Rustfmt
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Check code format
run: cargo fmt --check
clippy:
name: Rust Clippy
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Run clippy
run: cargo clippy -- -Dwarnings
# Use individual doctest due to https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile
doctest:
name: Rustdoc Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Test documentation
run: cargo test --verbose --doc -- --test-threads=1