Debian Codegraph @

.github/workflows/windows.yml

raw symbols SCIP
1 on: [push, pull_request]
2
3 name: CI Windows
4
5 # Least privilege: this workflow only reads the repo and runs tests.
6 permissions:
7 contents: read
8
9 jobs:
10 test-default-windows:
11 name: Windows vcpkg (default)
12 runs-on: windows-latest
13 env:
14 VCPKGRS_DYNAMIC: 1
15 VCPKG_DEFAULT_TRIPLET: x64-windows
16 VCPKG_ROOT: C:\vcpkg
17 steps:
18 - uses: actions/checkout@v6
19 - name: Setup vcpkg libxml2 Cache
20 uses: actions/cache@v4
21 id: vcpkg-cache
22 with:
23 path: C:\vcpkg
24 key: vcpkg-libxml2
25 - name: Install libxml2 with vcpkg
26 run: |
27 vcpkg install libxml2:x64-windows
28 vcpkg integrate install
29 - name: run tests
30 run: cargo test
31
32 test-mingw64-windows:
33 name: Windows (mingw64)
34 runs-on: windows-latest
35 defaults:
36 run:
37 shell: msys2 {0}
38 steps:
39 - uses: actions/checkout@v6
40 - uses: msys2/setup-msys2@v2
41 with:
42 path-type: minimal
43 release: false
44 update: false
45 msystem: MINGW64
46 install: >-
47 mingw64/mingw-w64-x86_64-pkg-config
48 mingw64/mingw-w64-x86_64-libxml2
49 - name: Install stable windows-gnu Rust toolchain
50 uses: dtolnay/rust-toolchain@master
51 with:
52 toolchain: stable-x86_64-pc-windows-gnu
53 targets: x86_64-pc-windows-gnu
54 - name: Ensure mingw64 pkg-config is in path
55 run: echo "C:\msys64\mingw64\bin" >> "$GITHUB_PATH"
56 # Run cargo in the default Windows shell, not the job's msys2 shell:
57 # rustup installs cargo to the Windows user profile, which
58 # `path-type: minimal` strips from the msys2 PATH (exit 127). The old
59 # actions-rs/cargo step ran in the runner's Windows context too, never
60 # msys2. mingw64/bin is on PATH via the step above, so pkg-config, gcc,
61 # and the libxml2 DLLs still resolve for the windows-gnu build.
62 - name: run tests
63 shell: pwsh
64 run: cargo test