-
Notifications
You must be signed in to change notification settings - Fork 14
82 lines (71 loc) · 2.21 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: build
on:
schedule:
- cron: '0 0 * * *'
push:
branches:
- main
tags:
- 'v*.*.*'
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
CARGO_UNSTABLE_SPARSE_REGISTRY: true
jobs:
build:
name: Check on ${{ matrix.rust }}
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.74.0 # MSRV
- stable
- nightly
steps:
- uses: actions/checkout@v3
- name: Install ${{ matrix.rust }}
run: |
rustup toolchain install ${{ matrix.rust }} --profile minimal --component rustfmt,clippy
rustup default ${{ matrix.rust }}
- name: Run cargo check
continue-on-error: ${{ matrix.rust == 'nightly' }}
run: cargo check
- name: Run cargo fmt
continue-on-error: ${{ matrix.rust == 'nightly' }}
run: cargo fmt --all -- --check
- name: Run cargo clippy
# Run clippy only on stable to ignore unreasonable old warnings.
continue-on-error: ${{ matrix.rust != 'stable' }}
run: cargo clippy -- -D warnings -W clippy::nursery
- name: Run cargo test (no-default-features)
continue-on-error: ${{ matrix.rust == 'nightly' }}
run: cargo test --release --no-default-features
- name: Run cargo test
continue-on-error: ${{ matrix.rust == 'nightly' }}
run: cargo test --release --all-features
- name: Run cargo test with AVX2
continue-on-error: ${{ matrix.rust == 'nightly' }}
env:
RUSTFLAGS: '-C target-feature=+avx2'
run: cargo test --release --all-features
- name: Run cargo doc
continue-on-error: ${{ matrix.rust == 'nightly' }}
run: cargo doc --no-deps
publish:
name: Publish
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ build ]
steps:
- uses: actions/checkout@v3
- name: Install latest stable
run: |
rustup toolchain install stable --profile minimal
rustup default stable
- name: Run cargo publish
working-directory: ${{github.workspace}}/vibrato
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}