-
Notifications
You must be signed in to change notification settings - Fork 27
105 lines (83 loc) · 2.75 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
name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
NIGHTLY: nightly-2023-12-28
jobs:
msrv_and_minimal_versions:
name: Check MSRV and minimal-versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: sd,cargo-hack
# workaround for https://github.com/rust-lang/rustup/issues/2925
- name: Set environment variables
run: |
echo "MSRV=$(cargo metadata --format-version=1 --no-deps --offline | sd '.*"rust_version":"([.0-9]+?)".*' '$1')" >> $GITHUB_ENV
- name: Install MSRV toolchain
run: rustup toolchain install $MSRV --no-self-update --profile=minimal
- name: Install nightly toolchain
run: rustup toolchain install $NIGHTLY --no-self-update --profile=minimal
# -Z avoid-dev-deps doesn't work
- run: cargo +$NIGHTLY hack generate-lockfile --remove-dev-deps -Z minimal-versions
- run: cargo +$MSRV check --workspace --all-features
format:
name: Check format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo fmt --check --all
clippy:
name: Check clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo clippy --all-targets --workspace --all-features -- -D warnings
doc_tests:
name: Run doc tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo test --doc --workspace --features mint,glam
docs:
name: Build docs
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: --cfg docs
steps:
- uses: actions/checkout@v4
- name: Install nightly toolchain
run: rustup toolchain install $NIGHTLY --no-self-update --profile=minimal
- run: cargo +$NIGHTLY doc --workspace --all-features
tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov,cargo-nextest
- name: Install llvmpipe and lavapipe
run: |
sudo apt-get update
sudo apt install -y mesa-vulkan-drivers vulkan-validationlayers
- run: cargo llvm-cov nextest --workspace --features mint,glam --fail-under-lines 80
tests_miri:
name: Run MIRI tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install nightly toolchain
run: |
rustup toolchain install $NIGHTLY --no-self-update --profile=minimal
rustup +$NIGHTLY component add miri
- run: cargo +$NIGHTLY miri test --workspace --features mint,glam