-
Notifications
You must be signed in to change notification settings - Fork 18
135 lines (125 loc) · 3.33 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Continuous integration
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
MIRIFLAGS: "-Zmiri-disable-isolation"
RUSTFLAGS: "-D warnings"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
# We have to test the MSRV without the zip crate, since the zip crate has a higher MSRV and
# doesn't consider a MSRV update to be a breaking change.
test_msrv:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.56.0 # MSRV
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Build
run: cargo build --no-default-features --features=num-complex-0_4 --verbose
- name: Run tests
run: cargo test --no-default-features --features=num-complex-0_4 --verbose
cross_test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
# 64-bit, big-endian
- rust: stable
target: powerpc64-unknown-linux-gnu
# 32-bit, little-endian
- rust: stable
target: i686-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- name: Install cross
run: cargo install cross -f
- name: Build
run: cross build --verbose --target=${{ matrix.target }}
- name: Run tests
run: cross test --verbose --target=${{ matrix.target }}
miri:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- nightly
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: miri
- name: Run tests with Miri
run: cargo miri test --verbose
clippy:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: clippy
- name: Clippy
run: cargo clippy
format:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: rustfmt
- name: Rustfmt
run: cargo fmt -- --check
coverage:
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate code coverage
run: cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true