build #774
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.70.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 }} |