Skip to content

Use taiki-e/install-action@v2 #37

Use taiki-e/install-action@v2

Use taiki-e/install-action@v2 #37

Workflow file for this run

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
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
key: test
toolchain: ${{ matrix.toolchain }}
components: clippy
- run: cargo test --workspace --all-targets
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
key: package
toolchain: stable
- run: cargo package --package zipsign
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
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
key: execute
toolchain: ${{ matrix.toolchain }}
- name: Execute example
run: |
cargo install --path .
zipsign gen-key priv.key pub.key
tar czf Cargo.lock.tgz Cargo.lock
zipsign sign tar -o Cargo.lock.signed.tgz Cargo.lock.tgz priv.key
rm Cargo.lock.tgz
mv Cargo.lock.signed.tgz Cargo.lock.tgz
zipsign verify tar Cargo.lock.tgz pub.key
zip Cargo.lock.zip Cargo.lock
zipsign sign zip -o Cargo.lock.signed.zip Cargo.lock.zip priv.key
rm Cargo.lock.zip
mv Cargo.lock.signed.zip Cargo.lock.zip
zipsign verify zip Cargo.lock.zip pub.key