forked from neogenie/fastnum
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (114 loc) · 3.77 KB
/
ci.yml
File metadata and controls
120 lines (114 loc) · 3.77 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
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
117
118
119
120
name: Rust CI
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
MSRV: '1.87'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Install Rust toolchain via rustup
run: |
rustup component add clippy
rustup component add rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
- name: Check linting
run: cargo clippy --all-targets --all-features -- -D warnings
docs:
name: Documentation
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-docs-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-docs-
${{ runner.os }}-cargo-
- name: Install Rust nightly
run: rustup install nightly --profile minimal
- name: Build docs
run: cargo +nightly doc --all-features --no-deps
env:
RUSTDOCFLAGS: "--cfg docsrs -D warnings"
test:
name: Test (${{ matrix.rust-version }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
rust-version: [ '1.87', 'stable' ]
steps:
- uses: actions/checkout@v4
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.rust-version }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-${{ matrix.rust-version }}-
${{ runner.os }}-cargo-
- name: Install Rust ${{ matrix.rust-version }}
run: |
if [ "${{ matrix.rust-version }}" != "stable" ]; then
rustup install ${{ matrix.rust-version }} --profile minimal
fi
- name: Build (no features)
run: cargo +${{ matrix.rust-version }} build --no-default-features
- name: Build (default features)
run: cargo +${{ matrix.rust-version }} build
- name: Build (std feature)
run: cargo +${{ matrix.rust-version }} build --features std
- name: Build (numtraits feature)
run: cargo +${{ matrix.rust-version }} build --features numtraits
- name: Build (all features)
run: cargo +${{ matrix.rust-version }} build --all-features
- name: Test (no features)
run: cargo +${{ matrix.rust-version }} test --no-default-features
- name: Test (default features)
run: cargo +${{ matrix.rust-version }} test
- name: Test (std feature)
run: cargo +${{ matrix.rust-version }} test --features std
- name: Test (numtraits feature)
run: cargo +${{ matrix.rust-version }} test --features numtraits
- name: Test (test-util feature for integration tests)
run: cargo +${{ matrix.rust-version }} test --features test-util
- name: Test docs (all features)
run: cargo +${{ matrix.rust-version }} test --doc --all-features
check-msrv:
name: Verify MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cargo-msrv
run: cargo install cargo-msrv
- name: Verify MSRV
run: cargo msrv verify