Skip to content

CI

CI #204

Workflow file for this run

name: CI
on:
push:
branches: ['main']
pull_request:
branches: ['main']
schedule:
- cron: "58 7 * * 4"
jobs:
fmt:
strategy:
matrix:
toolchain:
- nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
strategy:
matrix:
toolchain:
- nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- run: cargo clippy --workspace --all-targets -- -D warnings
check:
strategy:
matrix:
toolchain:
- "1.81"
folder:
- "cli"
include:
- toolchain: "1.73"
folder: api
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- run: cargo check --all-targets
working-directory: ${{ matrix.folder }}
test:
strategy:
matrix:
toolchain:
- stable
os:
- ubuntu-22.04
- windows-2022
- macos-13
versions:
- ""
- "-Zminimal-versions"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Update lockfile
run: cargo generate-lockfile ${{ matrix.versions }}
env:
RUSTC_BOOTSTRAP: 1
- run: cargo test --workspace --all-targets
doc:
strategy:
matrix:
toolchain:
- nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- run: cargo doc --workspace --all-features --no-deps
env:
RUSTDOCFLAGS: -Z unstable-options --generate-link-to-definition --cfg=docsrs -D warnings
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
api-powerset:
strategy:
matrix:
toolchain:
- 1.73
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- 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-13
versions:
- ""
- "-Zminimal-versions"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Update lockfile
run: cargo generate-lockfile ${{ matrix.versions }}
env:
RUSTC_BOOTSTRAP: 1
- name: Execute example
run: |
cargo install --path cli
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:
strategy:
matrix:
toolchain:
- stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- 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:
strategy:
matrix:
toolchain:
- nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Install cargo-public-api
uses: taiki-e/install-action@v2
with:
tool: cargo-public-api
- run: cargo public-api -p zipsign-api
working-directory: api
- run: cargo public-api -p zipsign-api diff
working-directory: api
sort:
name: Check order in Cargo.toml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- run: cargo install --git https://github.com/DevinR528/cargo-sort.git --rev 3701753667c5d47ae166d6e5cd7a11384e068ed0
- run: cargo sort --workspace --grouped --check --check-format
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master