mirror of
https://github.com/storytold/winprint.rs.git
synced 2026-11-14 06:12:30 +00:00
Adds step-security/harden-runner (audit, pinned to v2.22.4 like craft-common-actions) as the first step of each job that did not have it, so every workflow in the org's public repos reports its egress to StepSecurity. Audit, not block: block-mode allow lists come from each job's observed traffic.
44 lines
1.4 KiB
YAML
44 lines
1.4 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@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
|
with:
|
|
egress-policy: audit
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
- name: Setup Rust toolchain
|
|
uses: moonrepo/setup-rust@v1
|
|
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
|