-
Notifications
You must be signed in to change notification settings - Fork 43
60 lines (48 loc) · 2.05 KB
/
rust.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
name: Rust
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: Test on ${{ matrix.os }} using Rust ${{ matrix.rust }} with features '${{ matrix.cargo_features }}'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable, nightly]
cargo_features: ['', 'alloc', 'default']
steps:
- uses: hecrj/setup-rust-action@v2
with:
rust-version: ${{ matrix.rust }}
targets: ${{ matrix.target }}
components: 'rustfmt, clippy'
- uses: actions/checkout@v4
- name: Install LLVM
if: matrix.os == 'windows-latest'
run: choco upgrade llvm -y
- name: Set clang path
if: matrix.os =='windows-latest'
run: echo "LIBCLANG_PATH=C:\Program Files\LLVM\bin" >> $GITHUB_ENV
shell: bash
- name: Cargo fmt
run: cargo +${{ matrix.rust }} fmt --all -- --check
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'nightly'
- name: Cargo clippy
run: cargo +${{ matrix.rust }} clippy --all-targets --workspace --no-default-features --features "${{ matrix.cargo_features }}"
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'nightly' && matrix.cargo_features == 'default'
- name: Test
run: cargo +${{ matrix.rust }} test --no-default-features --features "${{ matrix.cargo_features }}"
- name: Benchmark
run: cargo +${{ matrix.rust }} bench --no-default-features --features "${{ matrix.cargo_features }}"
if: matrix.rust == 'nightly' && matrix.cargo_features == 'default'
- name: Minimal versions
run: cargo +${{ matrix.rust }} -Zdirect-minimal-versions test --no-default-features --features "${{ matrix.cargo_features }}"
if: matrix.rust == 'nightly' && matrix.cargo_features == 'default'
- name: Updated versions
run: cargo update && cargo +${{ matrix.rust }} test --no-default-features --features "${{ matrix.cargo_features }}"
if: matrix.rust == 'stable' && matrix.cargo_features == 'default'