Skip to content

Pin GitHub Actions to full-length commit SHAs #1

Pin GitHub Actions to full-length commit SHAs

Pin GitHub Actions to full-length commit SHAs #1

name: Version Consistency Checks
on:
push:
branches-ignore:
- "gh-readonly-queue/**"
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.compare || github.head_ref || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
check-version-consistency:
name: Check Version Consistency
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
# All check steps use `if: '!cancelled()'` to ensure all checks run even if earlier ones fail,
# while still respecting manual workflow cancellations. The job will fail if any check fails.
- name: Check wdk-build version (README vs crates/wdk-build)
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: README.md
file1-label: "Repo README.md"
file1-version-regex: 'wdk-build\s*=\s*"\K[^"]+'
file1-version-label: "wdk-build version in README"
file2: crates/wdk-build/Cargo.toml
file2-version-regex: '^version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-build crate version"
error-message: "Please update README.md to match the wdk-build crate's version."
- name: Check wdk-sys and wdk-macros lockstep versioning
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/wdk-sys/Cargo.toml
file1-version-regex: '^version\s*=\s*"\K[^"]+'
file1-version-label: "wdk-sys crate version"
file2: crates/wdk-macros/Cargo.toml
file2-version-regex: '^version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-macros crate version"
error-message: "These crates must be versioned in lockstep because: (1) wdk-macros is a proc-macro crate that should only be consumed through wdk-sys re-exports, and (2) the two crates form a tightly coupled API surface. When updating either crate, both versions must be bumped together."
- name: Check workspace wdk-macros dependency version matches wdk-sys crate version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: Cargo.toml
file1-label: "workspace Cargo.toml"
file1-version-regex: 'wdk-macros\s*=\s*\{[^}]*version\s*=\s*"=\K[^"]+'
file1-version-label: "workspace wdk-macros dependency version"
file2: crates/wdk-sys/Cargo.toml
file2-version-regex: '^version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-sys crate version"
error-message: "The workspace dependency must use an exact version constraint of wdk-macros which matches wdk-sys to enforce lockstep versioning"
# Template version checks - ensure cargo-wdk templates use latest dep
# versions by comparing them against those in the workspace's Cargo.toml file
- name: Check KMDF template wdk version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/kmdf/Cargo.toml.tmp
file1-version-regex: '^wdk\s*=\s*"\K[^"]+'
file1-version-label: "wdk version in KMDF template"
file2: Cargo.toml
file2-version-regex: '^wdk\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk workspace dependency version"
- name: Check KMDF template wdk-build version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/kmdf/Cargo.toml.tmp
file1-version-regex: '^wdk-build\s*=\s*"\K[^"]+'
file1-version-label: "wdk-build version in KMDF template"
file2: Cargo.toml
file2-version-regex: '^wdk-build\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-build workspace dependency version"
- name: Check KMDF template wdk-alloc version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/kmdf/Cargo.toml.tmp
file1-version-regex: '^wdk-alloc\s*=\s*"\K[^"]+'
file1-version-label: "wdk-alloc version in KMDF template"
file2: Cargo.toml
file2-version-regex: '^wdk-alloc\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-alloc workspace dependency version"
- name: Check KMDF template wdk-panic version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/kmdf/Cargo.toml.tmp
file1-version-regex: '^wdk-panic\s*=\s*"\K[^"]+'
file1-version-label: "wdk-panic version in KMDF template"
file2: Cargo.toml
file2-version-regex: '^wdk-panic\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-panic workspace dependency version"
- name: Check KMDF template wdk-sys version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/kmdf/Cargo.toml.tmp
file1-version-regex: '^wdk-sys\s*=\s*"\K[^"]+'
file1-version-label: "wdk-sys version in KMDF template"
file2: Cargo.toml
file2-version-regex: '^wdk-sys\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-sys workspace dependency version"
- name: Check UMDF template wdk version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/umdf/Cargo.toml.tmp
file1-version-regex: '^wdk\s*=\s*"\K[^"]+'
file1-version-label: "wdk version in UMDF template"
file2: Cargo.toml
file2-version-regex: '^wdk\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk workspace dependency version"
- name: Check UMDF template wdk-build version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/umdf/Cargo.toml.tmp
file1-version-regex: '^wdk-build\s*=\s*"\K[^"]+'
file1-version-label: "wdk-build version in UMDF template"
file2: Cargo.toml
file2-version-regex: '^wdk-build\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-build workspace dependency version"
- name: Check UMDF template wdk-sys version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/umdf/Cargo.toml.tmp
file1-version-regex: '^wdk-sys\s*=\s*"\K[^"]+'
file1-version-label: "wdk-sys version in UMDF template"
file2: Cargo.toml
file2-version-regex: '^wdk-sys\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-sys workspace dependency version"
- name: Check WDM template wdk version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/wdm/Cargo.toml.tmp
file1-version-regex: '^wdk\s*=\s*"\K[^"]+'
file1-version-label: "wdk version in WDM template"
file2: Cargo.toml
file2-version-regex: '^wdk\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk workspace dependency version"
- name: Check WDM template wdk-build version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/wdm/Cargo.toml.tmp
file1-version-regex: '^wdk-build\s*=\s*"\K[^"]+'
file1-version-label: "wdk-build version in WDM template"
file2: Cargo.toml
file2-version-regex: '^wdk-build\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-build workspace dependency version"
- name: Check WDM template wdk-alloc version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/wdm/Cargo.toml.tmp
file1-version-regex: '^wdk-alloc\s*=\s*"\K[^"]+'
file1-version-label: "wdk-alloc version in WDM template"
file2: Cargo.toml
file2-version-regex: '^wdk-alloc\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-alloc workspace dependency version"
- name: Check WDM template wdk-panic version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/wdm/Cargo.toml.tmp
file1-version-regex: '^wdk-panic\s*=\s*"\K[^"]+'
file1-version-label: "wdk-panic version in WDM template"
file2: Cargo.toml
file2-version-regex: '^wdk-panic\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-panic workspace dependency version"
- name: Check WDM template wdk-sys version
if: '!cancelled()'
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/wdm/Cargo.toml.tmp
file1-version-regex: '^wdk-sys\s*=\s*"\K[^"]+'
file1-version-label: "wdk-sys version in WDM template"
file2: Cargo.toml
file2-version-regex: '^wdk-sys\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-sys workspace dependency version"