Skip to content

Commit f2d3de0

Browse files
Merge pull request #286 from expressvpn/winsup
CVPN-2220: Add windows support
2 parents 8d160c2 + ff114ae commit f2d3de0

File tree

19 files changed

+721
-67
lines changed

19 files changed

+721
-67
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/workflows/ci.yaml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717

1818
jobs:
1919
ci:
20-
needs: [earthly, coverage, build-ios, build-tvos]
20+
needs: [earthly, coverage, build-ios, build-tvos, build-windows]
2121
runs-on: ubuntu-latest
2222
if: always()
2323
steps:
@@ -179,3 +179,37 @@ jobs:
179179
run: cargo +$RUST_NIGHTLY_VERSION build -Zbuild-std --release --target aarch64-apple-tvos --features system_ca_certs -v -v
180180
- name: Build on tvOS Sim
181181
run: cargo +$RUST_NIGHTLY_VERSION build -Zbuild-std --release --target aarch64-apple-tvos-sim --target x86_64-apple-tvos --features system_ca_certs -v -v
182+
build-windows:
183+
strategy:
184+
fail-fast: false
185+
matrix:
186+
include:
187+
- target: x86_64-pc-windows-msvc
188+
os: windows-2022
189+
arch: x64
190+
- target: i686-pc-windows-msvc
191+
os: windows-2022
192+
arch: x86
193+
- target: aarch64-pc-windows-msvc
194+
os: windows-2022
195+
arch: arm64
196+
runs-on: ${{ matrix.os }}
197+
steps:
198+
- uses: actions/checkout@v4
199+
with:
200+
submodules: true
201+
- name: Setup Rust toolchain
202+
uses: dtolnay/rust-toolchain@master
203+
with:
204+
toolchain: ${{ env.RUST_VERSION }}
205+
target: ${{ matrix.target }}
206+
- name: Setup MSBuild
207+
uses: microsoft/setup-msbuild@v2
208+
with:
209+
vs-version: '17'
210+
- name: Build on Windows (${{ matrix.arch }})
211+
run: cargo build --release --target ${{ matrix.target }} -v -v
212+
- name: Test on Windows (${{ matrix.arch }})
213+
# Only run tests on native architecture (x64) since cross-compilation tests won't run
214+
if: matrix.target == 'x86_64-pc-windows-msvc'
215+
run: cargo test --release --target ${{ matrix.target }} -v -v

Cargo.lock

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Earthfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ build-android-release:
102102
# lint runs cargo clippy on the source code
103103
lint:
104104
FROM +copy-src
105-
DO lib-rust+CARGO --args="clippy --all-features --all-targets -- -D warnings"
105+
DO lib-rust+CARGO --args="clippy --all-features --lib --bins --tests --benches -- -D warnings"
106+
# examples/connect_pq requires postquantum. But kyber_only features disables post quantum.
107+
# So test examples separately
108+
DO lib-rust+CARGO --args="clippy --features postquantum --lib --bins --tests --benches --examples -- -D warnings"
106109
DO lib-rust+CARGO --args="clippy --no-default-features --all-targets -- -D warnings"
107110
ENV RUSTDOCFLAGS="-D warnings"
108111
DO lib-rust+CARGO --args="doc --all-features --document-private-items"

wolfssl-sys/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ edition.workspace = true
1515
bindgen = "0.72"
1616
autotools = "0.2"
1717
build-target = "0.8.0"
18+
msbuild = "0.1.0"
1819

1920
[dev-dependencies]
2021
test-case = "3.0"

0 commit comments

Comments
 (0)