Windows: rm instead of mv -f #36
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 | |
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-quickinstall | |
run: curl --location --silent --show-error --fail https://github.com/cargo-bins/cargo-quickinstall/releases/download/cargo-binstall-1.3.0/cargo-binstall-1.3.0-x86_64-unknown-linux-gnu.tar.gz | tar -xzvvf - -C $HOME/.cargo/bin | |
- name: Install cargo-audit | |
run: cargo binstall --no-confirm 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-quickinstall | |
run: curl --location --silent --show-error --fail https://github.com/cargo-bins/cargo-quickinstall/releases/download/cargo-binstall-1.3.0/cargo-binstall-1.3.0-x86_64-unknown-linux-gnu.tar.gz | tar -xzvvf - -C $HOME/.cargo/bin | |
- name: Install cargo-hack | |
run: cargo binstall --no-confirm 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 |