chore: bump to v1.0.0 #6
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: CI | |
on: | |
push: | |
branches: [main] | |
tags: ["*"] | |
pull_request: | |
branches: [main] | |
env: | |
RUST_BACKTRACE: 1 | |
jobs: | |
fmt: | |
name: Format | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Stable toolchain with rustfmt | |
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | |
with: | |
profile: minimal | |
toolchain: stable | |
components: rustfmt | |
- uses: swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
- name: Check coding style | |
run: cargo fmt --check --all | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Stable toolchain with clippy | |
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | |
with: | |
profile: minimal | |
toolchain: stable | |
components: clippy | |
- uses: swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
- name: Lint | |
run: cargo clippy --all-targets --all-features -- -D warnings | |
docs: | |
name: Docs | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
env: | |
RUSTDOCFLAGS: "-Dwarnings" | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Stable toolchain | |
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | |
with: | |
profile: minimal | |
toolchain: stable | |
- uses: swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
- run: cargo doc --no-deps | |
tests: | |
name: Tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Stable toolchain | |
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | |
with: | |
profile: minimal | |
toolchain: stable | |
- uses: swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
- uses: taiki-e/install-action@ef7090108a583d4124f188b4958359153b2d19e1 # nextest | |
- name: Test | |
run: cargo nextest run --all-features | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Stable toolchain | |
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | |
with: | |
toolchain: nightly | |
override: true | |
- uses: swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
- uses: taiki-e/install-action@ef7090108a583d4124f188b4958359153b2d19e1 # nextest | |
- name: Tests | |
run: cargo nextest run --all-features | |
env: | |
CARGO_INCREMENTAL: "0" | |
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" | |
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" | |
- name: Grcov | |
id: coverage | |
uses: actions-rs/grcov@770fa904bcbfc50da498080d1511da7388e6ddc6 # v0.1.6 | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 | |
with: | |
files: ${{ steps.coverage.outputs.report }} | |
flags: rust | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
build: | |
name: Build | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | |
with: | |
profile: minimal | |
toolchain: stable | |
- uses: swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
# msys2 required by rug on windows | |
- name: Setup msys2 (windows) | |
uses: msys2/setup-msys2@d0e80f58dffbc64f6a3a1f43527d469b4fc7b6c8 # v2.23.0 | |
if: matrix.os == 'windows-latest' | |
with: | |
install: base-devel pacman-mirrors diffutils m4 make openssl openssl-devel | |
pacboy: gcc:p rust:p | |
# Only for windows | |
- name: Msys2 build (windows) | |
if: matrix.os == 'windows-latest' | |
shell: msys2 {0} | |
run: | | |
cargo build | |
- name: Build | |
if: matrix.os != 'windows-latest' | |
run: cargo build | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: [fmt, clippy, docs, tests, build] | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- run: cargo publish --token ${CRATES_TOKEN} | |
env: | |
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} |