Skip to content

fix: enhance Windows CI workflow with short workspace mapping and imp… #219

fix: enhance Windows CI workflow with short workspace mapping and imp…

fix: enhance Windows CI workflow with short workspace mapping and imp… #219

Workflow file for this run

name: Windows
on:
push:
branches:
- trunk
- main
pull_request:
branches:
- trunk
- main
workflow_dispatch:
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
build:
strategy:
matrix:
include:
- os: "windows-2022"
config: vcpkg-VS-17
build: VS-17-Debug
fail-fast: false
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Create short workspace mapping
shell: bash
run: |
win_path=$(pwd -W)
cmd //C "subst T: \"$win_path\""
echo "SHORT_WORKSPACE=T:/" >> "$GITHUB_ENV"
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Cache vcpkg registry
uses: actions/cache@v4
with:
path: |
build/vcpkg_installed/
build/vcpkg_packages/
key: ${{ runner.os }}-vcpkg-${{ hashFiles('./vcpkg*.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: "17"
distribution: "temurin"
- name: Install rust dependencies
shell: bash
run: |
cd "$SHORT_WORKSPACE"
cargo install wasm-tools wit-bindgen-cli || true
- name: configure
shell: bash
run: |
cd "$SHORT_WORKSPACE"
cmake --preset ${{ matrix.config }}
- name: build
shell: bash
run: |
cd "$SHORT_WORKSPACE"
cmake --build --preset ${{ matrix.build }}
- name: test
shell: bash
run: |
cd "$SHORT_WORKSPACE/build"
ctest -C Debug -VV
- name: test-stubs-full (allowed to fail)
continue-on-error: true
shell: bash
run: |
cd "$SHORT_WORKSPACE/build"
echo "Running wit-stub-generation-test (failures expected and will be reported)..."
ctest -C Debug -VV -R "wit-stub-generation-test" > test_output.txt 2>&1 || true
cat test_output.txt
../.github/scripts/summarize-test-failures.sh test_output.txt test_summary.md
- name: Remove short workspace mapping
if: always()
shell: bash
run: |
cmd //C "subst T: /D" || true
- name: Upload error logs
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-logs
path: ./**/*.log