diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 7259de5..2c9278b 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -1,6 +1,16 @@ name: Audit -on: [push, pull_request] +on: + push: + branches: ["main"] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always jobs: audit: @@ -9,17 +19,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Cache cargo-audit - uses: actions/cache@v3 - with: - path: | - ~/.cargo/.crates.toml - ~/.cargo/.crates2.json - ~/.cargo/bin/cargo-audit - key: cargo-audit - - name: Install cargo-audit - run: cargo install cargo-audit - name: Checkout uses: actions/checkout@v4 + - uses: taiki-e/install-action@v2 + with: + tool: cargo-audit - name: Run Audit run: cargo audit -D warnings diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index dda66ce..e5e16ad 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,6 +1,16 @@ name: Format -on: [push, pull_request] +on: + push: + branches: ["main"] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always jobs: rustfmt: @@ -9,15 +19,14 @@ jobs: runs-on: ubuntu-latest steps: - - name: Update Rust + - name: Checkout + uses: actions/checkout@v4 + - name: Install Rust nightly run: | rustup toolchain install nightly --profile minimal --component rustfmt --allow-downgrade rustup default nightly - - name: Checkout - uses: actions/checkout@v4 - name: Run Rustfmt - run: - cargo fmt --check + run: cargo fmt --check taplo: name: Taplo @@ -25,17 +34,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Cache Taplo - uses: actions/cache@v3 - with: - path: | - ~/.cargo/.crates.toml - ~/.cargo/.crates2.json - ~/.cargo/bin/taplo - key: taplo - - name: Install Taplo - run: cargo install taplo-cli - name: Checkout uses: actions/checkout@v4 + - uses: taiki-e/install-action@v2 + with: + tool: taplo-cli - name: Run Taplo run: taplo fmt --check diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f7d4833..307df28 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,10 +1,22 @@ name: Lint -on: [push, pull_request] +on: + push: + branches: ["main"] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always jobs: clippy-rustdoc: - name: Clippy + Rustdoc + name: Clippy & Rustdoc + + runs-on: ubuntu-latest strategy: fail-fast: false @@ -33,15 +45,13 @@ jobs: - channel: nightly features: --all-features - runs-on: ubuntu-latest - steps: - - name: Update Rust + - name: Checkout + uses: actions/checkout@v4 + - name: Install Rust run: | rustup toolchain install ${{ matrix.channel }} --profile minimal --component clippy --allow-downgrade rustup default ${{ matrix.channel }} - - name: Checkout - uses: actions/checkout@v4 - name: Run Clippy run: cargo clippy --all-targets --workspace ${{ matrix.features }} -- -D warnings diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6e61043..c3dbccd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,16 @@ name: Publish -on: [push, pull_request] +on: + push: + branches: ["main"] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always jobs: publish: @@ -12,5 +22,4 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Test Publish - run: - cargo publish --dry-run + run: cargo publish --dry-run diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 52f611e..ce82f5c 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -1,29 +1,44 @@ name: Spellcheck -on: [push, pull_request] +on: + push: + branches: ["main"] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always jobs: - rustfmt: + spellcheck: name: Spellcheck runs-on: ubuntu-latest steps: - - name: Cache cargo-spellcheck - uses: actions/cache@v3 - with: - path: | - ~/.cargo/.crates.toml - ~/.cargo/.crates2.json - ~/.cargo/bin/cargo-spellcheck - key: cargo-spellcheck - - name: Install libclang-dev - run: sudo apt-get install libclang-dev - - name: Install cargo-spellcheck - run: cargo install cargo-spellcheck --locked - name: Checkout uses: actions/checkout@v4 + - uses: taiki-e/install-action@v2 + with: + tool: cargo-spellcheck - name: Run Spellcheck - run: cargo spellcheck check -m 1 2>/dev/null - - name: Run Spellcheck on CHANGELOG.md - run: cargo spellcheck check -m 1 CHANGELOG.md 2>/dev/null + run: | + cargo spellcheck check -m 1 + cargo spellcheck check -m 1 CHANGELOG.md + + typos: + name: Typos + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: taiki-e/install-action@v2 + with: + tool: typos-cli + - name: Run Typos + run: typos diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 929f2c3..61a4182 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,18 +1,30 @@ name: Test -on: [push, pull_request] +on: + push: + branches: ["main"] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always jobs: build-test: - name: Build + Test + name: Build & Test + + runs-on: ubuntu-latest strategy: fail-fast: false matrix: rust: - - 1.57.0 - - stable - - nightly + - { version: 1.57.0, msrv: true } + - { version: stable, msrv: false } + - { version: nightly, msrv: false } features: - "" - --features safe @@ -32,17 +44,15 @@ jobs: - rust: nightly features: --all-features - runs-on: ubuntu-latest - steps: - - name: Update Rust - run: | - rustup toolchain install ${{ matrix.rust }} --profile minimal --allow-downgrade - rustup default ${{ matrix.rust }} - name: Checkout uses: actions/checkout@v4 + - name: Install Rust + run: | + rustup toolchain install ${{ matrix.rust.version }} --profile minimal --allow-downgrade + rustup default ${{ matrix.rust.version }} - name: Pin `zeroize` for MSRV - if: matrix.rust == '1.57.0' + if: matrix.rust.msrv run: cargo update -p zeroize --precise 1.6.0 - name: Build @@ -58,13 +68,15 @@ jobs: no-std-build: name: no_std Build + runs-on: ubuntu-latest + strategy: fail-fast: false matrix: rust: - - 1.57.0 - - stable - - nightly + - { version: 1.57.0, msrv: true } + - { version: stable, msrv: false } + - { version: nightly, msrv: false } features: - "" - --features safe @@ -84,17 +96,15 @@ jobs: - rust: nightly features: --all-features - runs-on: ubuntu-latest - steps: - - name: Update Rust - run: | - rustup toolchain install ${{ matrix.rust }} --target thumbv6m-none-eabi --profile minimal --allow-downgrade - rustup default ${{ matrix.rust }} - name: Checkout uses: actions/checkout@v4 + - name: Install Rust + run: | + rustup toolchain install ${{ matrix.rust.version }} --target thumbv6m-none-eabi --profile minimal --allow-downgrade + rustup default ${{ matrix.rust.version }} - name: Pin `zeroize` for MSRV - if: matrix.rust == '1.57.0' + if: matrix.rust.msrv run: cargo update -p zeroize --precise 1.6.0 - name: Build @@ -104,6 +114,8 @@ jobs: minimal-versions: name: Minimal Versions + runs-on: ubuntu-latest + strategy: fail-fast: false matrix: @@ -113,18 +125,16 @@ jobs: - version: stable features: safe,zeroize-on-drop - runs-on: ubuntu-latest - steps: - - name: Update Rust + - name: Checkout + uses: actions/checkout@v4 + - name: Install Rust run: | rustup toolchain install ${{ matrix.rust.version }} --profile minimal --allow-downgrade rustup default ${{ matrix.rust.version }} - name: Install nightly Rust run: rustup toolchain install nightly --profile minimal --allow-downgrade - - name: Checkout - uses: actions/checkout@v4 - name: Build working-directory: test-crates/minimal-versions run: | diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index af40a15..4e07dc4 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,11 +1,23 @@ name: Validate -on: [push, pull_request] +on: + push: + branches: ["main"] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always jobs: miri: name: Miri + runs-on: ubuntu-latest + strategy: fail-fast: false matrix: @@ -13,15 +25,13 @@ jobs: - "" - --features nightly - runs-on: ubuntu-latest - steps: - - name: Update Rust + - name: Checkout + uses: actions/checkout@v4 + - name: Install Rust run: | rustup toolchain install nightly --profile minimal --component miri,rust-src --allow-downgrade rustup default nightly - - name: Checkout - uses: actions/checkout@v4 - name: Test run: cargo miri test --workspace ${{ matrix.features }} --all-targets --no-fail-fast