Skip to content

Commit 4010fa3

Browse files
committed
.github/rust: build and test on windows
Updates #65 Signed-off-by: Nathan Perry <nathan@tailscale.com> Change-Id: I5381bc94a5817a69cd848df929b5860c6a6a6964
1 parent 7b458f7 commit 4010fa3

1 file changed

Lines changed: 32 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ env:
3737
prev_rust: &prev_rust 1.93.1
3838
latest_rust: &latest_rust 1.94.0
3939

40+
41+
defaults:
42+
run:
43+
shell: bash
44+
4045
jobs:
4146
build_test:
4247
strategy:
@@ -51,6 +56,10 @@ jobs:
5156
runner: linux-arm64-16cpu
5257
- triple: aarch64-apple-darwin
5358
runner: macos-26
59+
- triple: x86_64-pc-windows-gnu
60+
runner: windows-8vcpu
61+
- triple: x86_64-pc-windows-msvc
62+
runner: windows-8vcpu
5463
toolchain:
5564
- version: *prev_rust
5665
label: prev
@@ -70,6 +79,7 @@ jobs:
7079
env:
7180
COMMON_FLAGS: --all-features --workspace
7281
CARGO_BUILD_TARGET: ${{ matrix.target.triple }}
82+
is_windows_gnu: ${{ endsWith(matrix.target.triple, '-windows-gnu') }}
7383

7484
steps:
7585
- name: Checkout
@@ -99,8 +109,28 @@ jobs:
99109
-- -D warnings -A missing_docs
100110
- name: Build (cargo build)
101111
run: cargo build $COMMON_FLAGS --all-targets
102-
- name: Test (cargo test)
103-
run: cargo test $COMMON_FLAGS
112+
113+
# `ts_cli_util` enables tracy when passed `--all-features`, which `*-windows-gnu`
114+
# targets appear to be allergic to.
115+
#
116+
# `ts_python` has the same lib name as the `tailscale` root crate, which again appears
117+
# to just be an issue on `*-windows-gnu` targets, so don't test it here (depend on
118+
# python tests instead).
119+
- name: Test (cargo test), --all-features
120+
run: |-
121+
cargo test \
122+
$COMMON_FLAGS \
123+
${{ case(env.is_windows_gnu == 'true', '--exclude ts_cli_util --exclude ts_python', '') }}
124+
125+
# See note on previous step: `ts_cli_util` (currently the only special-cased crate
126+
# like this) is built with default features to avoid apparent linker issues on
127+
# `*-windows-gnu` targets
128+
- name: Test (cargo test), --features default (select crates)
129+
if: ${{ env.is_windows_gnu }}
130+
run: |-
131+
cargo test \
132+
-p ts_cli_util
133+
104134
- name: Release build (cargo build --release)
105135
run: cargo build $COMMON_FLAGS --release --all-targets
106136
- name: Docs (cargo doc)

0 commit comments

Comments
 (0)