Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions .github/workflows/continuum-rust-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
cli: ${{ steps.select.outputs.cli }}
steps:
- uses: actions/checkout@v4
- run: node --test tools/scripts/tests/ci-change-scope.test.cjs tools/scripts/tests/ci-cargo-freshness.test.cjs
- run: node --test tools/scripts/tests/ci-change-scope.test.cjs tools/scripts/tests/ci-cargo-freshness.test.cjs tools/scripts/tests/ci-windows-check.test.cjs
- uses: actions/github-script@v7
id: select
with:
Expand Down Expand Up @@ -535,18 +535,51 @@ jobs:
if: needs.changes.outputs.rust != 'false'
run: cargo test -p continuum-cli-lifecycle

# Preserve the required Windows context; neither child can silently disappear.
# Real native compilation for Rust changes, including canary PRs. Keep linking and
# custody execution in their existing contracts; this cache stores check artifacts.
windows-type-check:
name: Native MSVC type-check (headless lib + tests)
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
needs: changes
if: ${{ needs.changes.outputs.rust == 'true' }}
runs-on: windows-latest
# Cold-cache ceiling, not a claim that the warm <10-minute target is proven.
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Resolve pinned toolchain
run: |
rustup show active-toolchain
rustc --version
- uses: Swatinem/rust-cache@v2
with:
shared-key: continuum-windows-check-v1
save-if: ${{ github.event_name != 'pull_request' }}
cache-workspace-crates: true
- name: Type-check native Windows libraries and test targets
shell: pwsh
run: ./tools/scripts/ci-windows-check.ps1

# Preserve the required Windows context; selected compilation cannot silently disappear.
cargo-check-windows:
name: cargo check windows-msvc (lib + tests)
needs: [windows-core-contract, windows-lifecycle-contract]
needs: [changes, windows-type-check, windows-core-contract, windows-lifecycle-contract]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require both Windows contracts
env:
SELECT_RESULT: ${{ needs.changes.result }}
RUST_CHANGED: ${{ needs.changes.outputs.rust }}
CHECK_RESULT: ${{ needs.windows-type-check.result }}
CORE_RESULT: ${{ needs.windows-core-contract.result }}
LIFECYCLE_RESULT: ${{ needs.windows-lifecycle-contract.result }}
run: |
ok() { test "$1" = success || test "$1" = skipped; } # skipped = a canary PR, by design
test "$SELECT_RESULT" = success
if [ "$RUST_CHANGED" = true ]; then test "$CHECK_RESULT" = success; else test "$RUST_CHANGED" = false; fi
ok "$CORE_RESULT" && ok "$LIFECYCLE_RESULT"
10 changes: 10 additions & 0 deletions tools/scripts/ci-windows-check.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Run the native MSVC type-check without linking resident binaries or running custody tests.
# The workflow owns cache restoration; this command is identical on a non-serving dev machine.
$ErrorActionPreference = 'Stop'
if (-not $env:CARGO_TARGET_DIR) { throw 'Set CARGO_TARGET_DIR to the configured shared build cache before checking.' }
$checkTimer = [Diagnostics.Stopwatch]::StartNew()
& cargo check --locked --target x86_64-pc-windows-msvc --profile dev-fast -p continuum-core -p continuum-cli-lifecycle --lib --tests --features continuum-core/test-fixtures
$checkExit = $LASTEXITCODE
$checkTimer.Stop()
Write-Output "Windows type-check elapsed seconds: $($checkTimer.Elapsed.TotalSeconds)"
if ($checkExit -ne 0) { exit $checkExit }
31 changes: 31 additions & 0 deletions tools/scripts/tests/ci-windows-check.test.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const { test } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const { spawnSync } = require('node:child_process');
const root = path.resolve(__dirname, '../../..');
const workflow = fs.readFileSync(path.join(root, '.github/workflows/continuum-rust-tests.yml'), 'utf8');
const gate = workflow.slice(workflow.indexOf(' cargo-check-windows:'));
const run = gate.split(' run: |')[1].split('\n').filter(line => line.startsWith(' ')).map(line => line.slice(10)).join('\n');
function verdict(overrides) {
const result = spawnSync(process.env.CI_TEST_BASH || 'bash', ['-e', '-c', run], {
env: { ...process.env, SELECT_RESULT: 'success', RUST_CHANGED: 'true', CHECK_RESULT: 'success', CORE_RESULT: 'skipped', LIFECYCLE_RESULT: 'skipped', ...overrides }, encoding: 'utf8'
});
assert.ifError(result.error);
if (result.status !== 0 && result.stderr) process.stderr.write(result.stderr);
return result.status;
}
test('selected Windows compilation cannot pass through skipped, failed, or cancelled jobs', () => {
// Regression: the required context used to pass when both native jobs skipped.
assert.equal(verdict({}), 0);
for (const CHECK_RESULT of ['skipped', 'failure', 'cancelled', '']) assert.notEqual(verdict({ CHECK_RESULT }), 0);
for (const SELECT_RESULT of ['skipped', 'failure', 'cancelled']) assert.notEqual(verdict({ SELECT_RESULT }), 0);
for (const RUST_CHANGED of ['', 'unknown']) assert.notEqual(verdict({ RUST_CHANGED }), 0);
});
test('docs may skip compilation but existing custody failures still fail the gate', () => {
// Regression: adding the fast compile must not hide an existing native-contract failure.
assert.equal(verdict({ RUST_CHANGED: 'false', CHECK_RESULT: 'skipped' }), 0);
for (const field of ['CORE_RESULT', 'LIFECYCLE_RESULT']) {
for (const value of ['failure', 'cancelled']) assert.notEqual(verdict({ [field]: value }), 0);
}
});
Loading