Skip to content
Merged
171 changes: 171 additions & 0 deletions .github/workflows/version-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,174 @@ jobs:
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 templates use latest workspace versions
Comment thread
gurry marked this conversation as resolved.
Outdated

Comment thread
gurry marked this conversation as resolved.
Outdated
- name: Check KMDF template wdk version
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/kmdf/Cargo.toml.tmp
file1-label: "KMDF template"
Comment thread
gurry marked this conversation as resolved.
Outdated
file1-version-regex: '^wdk\s*=\s*"\K[^"]+'
file1-version-label: "wdk version in KMDF template"
file2: Cargo.toml
file2-label: "workspace Cargo.toml"
file2-version-regex: '^wdk\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk workspace dependency version"
error-message: "KMDF template must use the same wdk version as defined in workspace dependencies."

- name: Check KMDF template wdk-build version
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/kmdf/Cargo.toml.tmp
file1-label: "KMDF template"
file1-version-regex: '^wdk-build\s*=\s*"\K[^"]+'
file1-version-label: "wdk-build version in KMDF template"
file2: Cargo.toml
file2-label: "workspace Cargo.toml"
file2-version-regex: '^wdk-build\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-build workspace dependency version"
error-message: "KMDF template must use the same wdk-build version as defined in workspace dependencies."

- name: Check KMDF template wdk-alloc version
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/kmdf/Cargo.toml.tmp
file1-label: "KMDF template"
file1-version-regex: '^wdk-alloc\s*=\s*"\K[^"]+'
file1-version-label: "wdk-alloc version in KMDF template"
file2: Cargo.toml
file2-label: "workspace Cargo.toml"
file2-version-regex: '^wdk-alloc\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-alloc workspace dependency version"
error-message: "KMDF template must use the same wdk-alloc version as defined in workspace dependencies."

- name: Check KMDF template wdk-panic version
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/kmdf/Cargo.toml.tmp
file1-label: "KMDF template"
file1-version-regex: '^wdk-panic\s*=\s*"\K[^"]+'
file1-version-label: "wdk-panic version in KMDF template"
file2: Cargo.toml
file2-label: "workspace Cargo.toml"
file2-version-regex: '^wdk-panic\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-panic workspace dependency version"
error-message: "KMDF template must use the same wdk-panic version as defined in workspace dependencies."

- name: Check KMDF template wdk-sys version
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/kmdf/Cargo.toml.tmp
file1-label: "KMDF template"
file1-version-regex: '^wdk-sys\s*=\s*"\K[^"]+'
file1-version-label: "wdk-sys version in KMDF template"
file2: Cargo.toml
file2-label: "workspace Cargo.toml"
file2-version-regex: '^wdk-sys\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-sys workspace dependency version"
error-message: "KMDF template must use the same wdk-sys version as defined in workspace dependencies."

- name: Check UMDF template wdk version
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/umdf/Cargo.toml.tmp
file1-label: "UMDF template"
file1-version-regex: '^wdk\s*=\s*"\K[^"]+'
file1-version-label: "wdk version in UMDF template"
file2: Cargo.toml
file2-label: "workspace Cargo.toml"
file2-version-regex: '^wdk\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk workspace dependency version"
error-message: "UMDF template must use the same wdk version as defined in workspace dependencies."

- name: Check UMDF template wdk-build version
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/umdf/Cargo.toml.tmp
file1-label: "UMDF template"
file1-version-regex: '^wdk-build\s*=\s*"\K[^"]+'
file1-version-label: "wdk-build version in UMDF template"
file2: Cargo.toml
file2-label: "workspace Cargo.toml"
file2-version-regex: '^wdk-build\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-build workspace dependency version"
error-message: "UMDF template must use the same wdk-build version as defined in workspace dependencies."

- name: Check UMDF template wdk-sys version
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/umdf/Cargo.toml.tmp
file1-label: "UMDF template"
file1-version-regex: '^wdk-sys\s*=\s*"\K[^"]+'
file1-version-label: "wdk-sys version in UMDF template"
file2: Cargo.toml
file2-label: "workspace Cargo.toml"
file2-version-regex: '^wdk-sys\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-sys workspace dependency version"
error-message: "UMDF template must use the same wdk-sys version as defined in workspace dependencies."

- name: Check WDM template wdk version
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/wdm/Cargo.toml.tmp
file1-label: "WDM template"
file1-version-regex: '^wdk\s*=\s*"\K[^"]+'
file1-version-label: "wdk version in WDM template"
file2: Cargo.toml
file2-label: "workspace Cargo.toml"
file2-version-regex: '^wdk\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk workspace dependency version"
error-message: "WDM template must use the same wdk version as defined in workspace dependencies."

- name: Check WDM template wdk-build version
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/wdm/Cargo.toml.tmp
file1-label: "WDM template"
file1-version-regex: '^wdk-build\s*=\s*"\K[^"]+'
file1-version-label: "wdk-build version in WDM template"
file2: Cargo.toml
file2-label: "workspace Cargo.toml"
file2-version-regex: '^wdk-build\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-build workspace dependency version"
error-message: "WDM template must use the same wdk-build version as defined in workspace dependencies."

- name: Check WDM template wdk-alloc version
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/wdm/Cargo.toml.tmp
file1-label: "WDM template"
file1-version-regex: '^wdk-alloc\s*=\s*"\K[^"]+'
file1-version-label: "wdk-alloc version in WDM template"
file2: Cargo.toml
file2-label: "workspace Cargo.toml"
file2-version-regex: '^wdk-alloc\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-alloc workspace dependency version"
error-message: "WDM template must use the same wdk-alloc version as defined in workspace dependencies."

- name: Check WDM template wdk-panic version
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/wdm/Cargo.toml.tmp
file1-label: "WDM template"
file1-version-regex: '^wdk-panic\s*=\s*"\K[^"]+'
file1-version-label: "wdk-panic version in WDM template"
file2: Cargo.toml
file2-label: "workspace Cargo.toml"
file2-version-regex: '^wdk-panic\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-panic workspace dependency version"
error-message: "WDM template must use the same wdk-panic version as defined in workspace dependencies."

- name: Check WDM template wdk-sys version
uses: ./.github/actions/compare-regex-versions
with:
file1: crates/cargo-wdk/templates/wdm/Cargo.toml.tmp
file1-label: "WDM template"
file1-version-regex: '^wdk-sys\s*=\s*"\K[^"]+'
file1-version-label: "wdk-sys version in WDM template"
file2: Cargo.toml
file2-label: "workspace Cargo.toml"
file2-version-regex: '^wdk-sys\s*=\s*\{[^}]*version\s*=\s*"\K[^"]+'
file2-version-label: "wdk-sys workspace dependency version"
error-message: "WDM template must use the same wdk-sys version as defined in workspace dependencies."
10 changes: 5 additions & 5 deletions crates/cargo-wdk/templates/kmdf/Cargo.toml.tmp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ target-kmdf-version-minor = 33
crate-type = ["cdylib"]

[build-dependencies]
wdk-build = "0.3.0"
wdk-build = "0.5.0"

[dependencies]
wdk = "0.3.0"
wdk-alloc = "0.3.0"
wdk-panic = "0.3.0"
wdk-sys = "0.3.0"
wdk = "0.4.0"
wdk-alloc = "0.4.0"
wdk-panic = "0.4.0"
wdk-sys = "0.5.0"

[features]
default = []
Expand Down
6 changes: 3 additions & 3 deletions crates/cargo-wdk/templates/umdf/Cargo.toml.tmp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ target-umdf-version-minor = 33
crate-type = ["cdylib"]

[build-dependencies]
wdk-build = "0.3.0"
wdk-build = "0.5.0"

[dependencies]
wdk = "0.3.0"
wdk-sys = "0.3.0"
wdk = "0.4.0"
wdk-sys = "0.5.0"

[features]
default = []
Expand Down
10 changes: 5 additions & 5 deletions crates/cargo-wdk/templates/wdm/Cargo.toml.tmp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ driver-type = "WDM"
crate-type = ["cdylib"]

[build-dependencies]
wdk-build = "0.3.0"
wdk-build = "0.5.0"

[dependencies]
wdk = "0.3.0"
wdk-alloc = "0.3.0"
wdk-panic = "0.3.0"
wdk-sys = "0.3.0"
wdk = "0.4.0"
wdk-alloc = "0.4.0"
wdk-panic = "0.4.0"
wdk-sys = "0.5.0"

[features]
default = []
Expand Down
Loading