CI #164
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'] | |
pull_request: | |
branches: ['main'] | |
schedule: | |
- cron: "58 7 * * 4" | |
jobs: | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
key: fmt | |
toolchain: nightly | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
clippy: | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
key: clippy | |
toolchain: ${{ matrix.toolchain }} | |
components: clippy | |
- run: cargo clippy --workspace --all-targets -- -D warnings | |
check: | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
key: check | |
toolchain: ${{ matrix.toolchain }} | |
- run: cargo check --workspace --all-targets | |
test: | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
os: | |
- ubuntu-22.04 | |
- windows-2022 | |
- macos-12 | |
versions: | |
- "" | |
- "-Zminimal-versions" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
key: test${{ matrix.versions }} | |
toolchain: ${{ matrix.toolchain }} | |
components: clippy | |
- name: Update lockfile | |
run: cargo generate-lockfile ${{ matrix.versions }} | |
env: | |
RUSTC_BOOTSTRAP: 1 | |
- run: cargo test --workspace --all-targets | |
doc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
key: doc | |
toolchain: nightly | |
- run: cargo +nightly doc --all-features --no-deps | |
env: | |
RUSTDOCFLAGS: "--cfg docsrs -D warnings" | |
audit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
key: audit | |
toolchain: stable | |
- name: Install cargo-audit | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-audit | |
- name: Run audit | |
run: cargo audit --deny warnings | |
api-powerset: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
key: api-powerset | |
toolchain: stable | |
- name: Install cargo-hack | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-hack | |
- name: Check powerset | |
run: cargo hack check --feature-powerset --package zipsign-api | |
env: | |
RUSTFLAGS: "-D warnings" | |
execute: | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
os: | |
- ubuntu-22.04 | |
- windows-2022 | |
- macos-12 | |
versions: | |
- "" | |
- "-Zminimal-versions" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
key: execute${{ matrix.versions }} | |
toolchain: ${{ matrix.toolchain }} | |
- name: Update lockfile | |
run: cargo generate-lockfile ${{ matrix.versions }} | |
env: | |
RUSTC_BOOTSTRAP: 1 | |
- name: Execute example | |
run: | | |
cargo install --path . | |
zipsign gen-key priv.key pub.key | |
tar czf Cargo.lock.tgz Cargo.lock | |
zipsign sign tar Cargo.lock.tgz priv.key | |
zipsign verify tar Cargo.lock.tgz pub.key | |
zipsign unsign tar Cargo.lock.tgz | |
# Windows doesn't have a "zip" command | |
jar -cfM Cargo.lock.zip Cargo.lock | |
zipsign sign zip Cargo.lock.zip priv.key | |
zipsign verify zip Cargo.lock.zip pub.key | |
zipsign unsign zip Cargo.lock.zip | |
semver-checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
key: semver-checks | |
toolchain: stable | |
- name: Install cargo-semver-checks | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-semver-checks | |
- run: cargo semver-checks -p zipsign-api --only-explicit-features | |
- run: cargo semver-checks -p zipsign-api --default-features | |
- run: cargo semver-checks -p zipsign-api --all-features | |
public-api: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
key: public-api | |
toolchain: nightly | |
- name: Install cargo-public-api | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-public-api | |
- run: cargo public-api -p zipsign-api | |
- run: cargo public-api -p zipsign-api diff |