open-standards/.github/workflows/wai-key-windows.yml
Transaction Science 5bb55a16e0
Some checks failed
wai key · Windows / does this change touch it (push) Successful in 36s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (push) Has been cancelled
wai key · Windows / wai key and the toolchain's tests · windows (push) Has been cancelled
WAI breaking changes and the conformance runner / WAI breaking · does this change touch WAI (push) Successful in 8s
WAI breaking changes and the conformance runner / WAI breaking · wire, record and API against main · linux (push) Successful in 47s
WAI breaking changes and the conformance runner / WAI breaking and conform · their tests, and the independent verifiers through wai conform · linux (push) Successful in 4m13s
CI: wai key's Windows tests, and a Windows checkout keeps the bytes wai embeds
wai-key-windows.yml runs cargo test --bin wai --test cli_key --test cli_toolchain on
the windows runner, for a pull request whose own diff changes key.rs, win_acl.rs,
out.rs, conform/adapter.rs, tests/cli_key.rs or the workflow, behind a gate on Linux.
It is its own file so that a change to win_acl.rs does not start the macOS runner.

The runner's git has core.autocrlf=true, so a checkout there turns LF into CRLF unless
.gitattributes says not to. Under it, four tests that passed from a tar failed: the
catalogue's digest against ops.json, and three over the templates wai create embeds.
ops.json, wai/examples and the licence are now -text, as REGISTRY.md already was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 17:21:42 -05:00

146 lines
7.2 KiB
YAML

name: wai key · Windows
# What holds `wai key` on Windows, where no other job builds it: a seed made under an access list for
# its account alone, refused when another account may read it, and `--key <name>` on the operations
# that sign (wai-rs/src/bin/wai_cli/win_acl.rs, tests/cli_key.rs). It runs the binary's own tests and
# tests/cli_toolchain.rs too, as they stand on that system. The Unix side is in wai-catalogue.yml, and
# the macOS keychain in wai-key-keychain.yml, a workflow of its own so that a change here does not
# start that runner.
#
# It runs on one thing alone: a pull request whose own diff changes a path below. The forge's filter
# matches a push's delta, so a rebase can fire it; the gate (on Linux) reads the pull request's own
# diff, and the Windows job does not start without it. The paths are what decides the behaviour:
# key.rs, win_acl.rs and the test; out.rs, which alone sends a private file through win_acl.rs; and
# conform/adapter.rs, whose cmd line for Windows only this job's tests run. Not wai-rs/Cargo.toml,
# which nearly every change to the crate touches.
#
# Not a required status, as wai-byte-equality.yml's Windows leg is not. A job on an offline runner
# stays pending and never settles.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [main]
paths:
- 'wai/wai-rs/src/bin/wai_cli/dx/key.rs'
- 'wai/wai-rs/src/bin/wai_cli/win_acl.rs'
- 'wai/wai-rs/src/bin/wai_cli/out.rs'
- 'wai/wai-rs/src/bin/wai_cli/dx/conform/adapter.rs'
- 'wai/wai-rs/tests/cli_key.rs'
- '.github/workflows/wai-key-windows.yml'
pull_request:
paths:
- 'wai/wai-rs/src/bin/wai_cli/dx/key.rs'
- 'wai/wai-rs/src/bin/wai_cli/win_acl.rs'
- 'wai/wai-rs/src/bin/wai_cli/out.rs'
- 'wai/wai-rs/src/bin/wai_cli/dx/conform/adapter.rs'
- 'wai/wai-rs/tests/cli_key.rs'
- '.github/workflows/wai-key-windows.yml'
jobs:
relevant:
name: does this change touch it
runs-on: gate
outputs:
run: ${{ steps.gate.outputs.run }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- id: gate
run: |
set -euo pipefail
r=$(python3 scripts/pr-touches-paths.py .github/workflows/wai-key-windows.yml \
"${{ github.event.pull_request.base.sha }}" \
"${{ github.event.pull_request.head.sha }}")
echo "this change touches wai key on Windows: $r"
echo "run=$r" >> "$GITHUB_OUTPUT"
tests:
name: wai key and the toolchain's tests · windows
needs: relevant
if: needs.relevant.outputs.run == 'true'
runs-on: windows
timeout-minutes: 45
env:
# The runner's host is shared with its other jobs, so a modest build, with no debug information:
# a clean target of about 2 GiB, measured on that host.
CARGO_BUILD_JOBS: '8'
CARGO_PROFILE_DEV_DEBUG: '0'
# The floor of the disk check below, in GiB: the checkout and that target, and room for the
# jobs beside it.
DISK_FLOOR_GIB: '8'
steps:
- uses: actions/checkout@v5
# Infrastructure first, so a full disk does not read as a failure of `wai key`.
- name: "infrastructure: this runner's disk has room for the job"
shell: pwsh
run: |
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
$root = [System.IO.Path]::GetPathRoot($PWD.Path)
$free = [System.IO.DriveInfo]::new($root).AvailableFreeSpace
Write-Output "${root}: $([math]::Floor($free / 1GB)) GiB free"
if ($free -lt ([int64]$env:DISK_FLOOR_GIB * 1GB)) {
Write-Output "::error::infrastructure: $root has $([math]::Floor($free / 1GB)) GiB free, below the floor of $env:DISK_FLOOR_GIB GiB: not a failure of wai key"
exit 1
}
# The pin comes from rust-toolchain.toml; this makes sure it is there. The runner's user owns
# rustup, and its default is left as it is for the host's other jobs.
- name: Put cargo on PATH, and Rust 1.99.1 on the host
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
$cargo = Join-Path $HOME '.cargo\bin'
$cargo | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
$env:PATH = "$cargo;$env:PATH"
$ErrorActionPreference = 'Continue'
rustup toolchain install 1.99.1 --profile minimal
if ($LASTEXITCODE -ne 0) { throw "rustup failed" }
# What the access-list tests ran as. An elevated session's default owner differs from a limited
# one's, so a result here says which it is about.
- name: The account and token this job runs as
shell: pwsh
run: |
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
$id = [Security.Principal.WindowsIdentity]::GetCurrent()
$admin = ([Security.Principal.WindowsPrincipal]$id).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
Write-Output "account $($id.Name), SID $($id.User.Value), elevated: $admin"
- name: The tests
shell: pwsh
working-directory: wai/wai-rs
run: |
$ErrorActionPreference = 'Stop'
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
# As the release job does. Nothing here reads it, so the tests see what a person's shell gives.
Remove-Item Env:CI -ErrorAction SilentlyContinue
$log = Join-Path $env:RUNNER_TEMP 'test.log'
# cargo writes its progress to stderr; the exit status is what counts.
$ErrorActionPreference = 'Continue'
cargo test --locked --no-default-features --features quickstart --bin wai --test cli_key --test cli_toolchain --no-fail-fast *> $log
$rc = $LASTEXITCODE
$ErrorActionPreference = 'Stop'
Get-Content $log
if ($rc -ne 0) { throw "the tests failed ($rc)" }
$text = Get-Content $log -Raw
if ($text -notmatch '(?m)^test result: ok\. [1-9][0-9]* passed; 0 failed') { throw "no test ran" }
# What only this system compiles: each by name, so a change of cfg cannot leave it out.
foreach ($t in @(
'access_lists::a_keystore_in_a_folder_every_user_shares_gets_what_one_in_a_profile_gets',
'access_lists::a_seed_another_account_may_read_signs_nothing_until_the_fix_it_names',
'access_lists::the_default_keystore_under_appdata_works_end_to_end',
'out::win_acl::tests::a_file_and_a_directory_are_this_accounts_from_their_creation',
'dx::conform::adapter::tests::cmd_gets_the_command_line_as_it_is_written'
)) {
if ($text -notmatch ('(?m)^test ' + [regex]::Escape($t) + ' \.\.\. ok\r?$')) { throw "the test $t did not run and pass" }
}
# The runner removes a stale workspace only after a day; this one's target goes now.
- name: Free the target directory
if: always()
shell: pwsh
run: |
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
Remove-Item -Recurse -Force wai\wai-rs\target -ErrorAction SilentlyContinue