Files
winprint.rs/.github/workflows/test.yml
Dylan M. Taylor cf63a769a5 ci: lock workflow actions through an actions.lock lockfile
Mutable action tags are a supply-chain risk: a moved tag runs different code
without a diff. Every workflow action is now pinned through
.github/workflows/actions.lock, and CI verifies the lockfile so an out-of-sync
or tampered one fails instead of running.
2026-11-12 10:10:22 -05:00

44 lines
1.3 KiB
YAML

name: Test
on:
# Pull requests are tested by the pull_request event; pushing to every branch as well ran the
# same Windows feature matrix twice for each branch in this repository.
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
# Pull requests share one group per branch, so a newer push cancels the older run. Every other
# run (main, manual) gets a group of its own, so it is neither cancelled nor replaced while queued.
group: test-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: windows-latest
steps:
- name: Harden runner
uses: step-security/harden-runner@v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@v7.0.1
- name: Setup Rust toolchain
uses: moonrepo/setup-rust@v1.3.0
with:
channel: stable
bins: cargo-hack
# Save the dependency cache from main only; pull requests restore it. Each pull request
# used to save its own 0.5-1 GB copy that no other branch can restore.
cache-base: main
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Test
run: cargo hack test --all-targets --each-feature --verbose