CI #381
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
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
pull_request: | |
schedule: | |
- cron: "17 3 * * 2" | |
name: CI | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: {"RUSTFLAGS": "-D warnings"} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo build | |
- run: cargo build --features num-complex | |
- run: cargo build --all-features | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo test --all-features | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- run: cargo clippy --all-features -- --deny warnings | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- run: cargo +nightly fmt -- --check | |
doc: | |
runs-on: ubuntu-latest | |
env: {"RUSTDOCFLAGS": "-D warnings"} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo doc --no-default-features | |
- run: cargo doc --all-features | |
rustdoc: | |
runs-on: ubuntu-latest | |
env: {"RUSTDOCFLAGS": "-D warnings --cfg docsrs"} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
- run: cargo +nightly rustdoc --all-features | |
release: | |
name: crates.io release | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [build, test, clippy, format, doc, rustdoc] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo publish --token ${CRATES_IO_TOKEN} | |
env: | |
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} |