Skip to content

Commit 9bcec89

Browse files
committed
Stop testing OpenSSL on Windows
1 parent b7bc05d commit 9bcec89

3 files changed

Lines changed: 28 additions & 14 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,25 @@ jobs:
5656
with:
5757
tool: cargo-c
5858

59-
- name: Install OpenSSL (Windows)
60-
if: runner.os == 'Windows'
61-
shell: powershell
62-
run: |
63-
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
64-
vcpkg install openssl:x64-windows-static-md
65-
6659
- name: Check all targets
60+
if: matrix.os != 'windows-latest'
6761
run: cargo check --locked --all-features --all-targets
62+
- name: Check all targets (Windows) # Skip upki-openssl on Windows because it requires OpenSSL to be installed
63+
if: matrix.os == 'windows-latest'
64+
run: cargo check --locked -p upki -p rustls-upki -p upki-cli -p upki-mirror -p revoke-test --all-features --all-targets
6865
- name: Run tests (debug)
69-
run: cargo test --locked
66+
if: matrix.os != 'windows-latest'
67+
run: cargo test --locked -p upki -p rustls-upki -p upki-cli -p upki-mirror -p revoke-test
68+
- name: Run tests (debug, Windows) # Skip upki-openssl on Windows because it requires OpenSSL to be installed
69+
if: matrix.os == 'windows-latest'
70+
run: cargo test -p revoke-test -p rustls-upki -p upki
7071
- name: Without features
7172
run: cargo check --locked -p upki --no-default-features
7273

7374
- name: Build FFI
7475
run: cargo cbuild --locked -p upki
7576
- name: Build OpenSSL integration
77+
if: runner.os != 'Windows'
7678
run: cargo cbuild --locked -p upki-openssl
7779

7880
- name: Run system tests (release)

revoke-test/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ x509-parser.workspace = true
2323
[dev-dependencies]
2424
criterion.workspace = true
2525
insta-cmd.workspace = true
26-
openssl-sys.workspace = true
2726
rustls-pki-types.workspace = true
2827
rustls-upki.workspace = true
2928
upki = { path = "../upki", features = ["capi", "fetch"] }
29+
30+
[target.'cfg(not(windows))'.dev-dependencies]
31+
openssl-sys.workspace = true
3032
upki-openssl = { path = "../upki-openssl" }
3133

3234
[features]

revoke-test/tests/system_tests.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use rustls_upki::{Policy, ServerVerifier};
1818

1919
#[path = "api/ffi.rs"]
2020
mod ffi;
21+
#[cfg(not(windows))]
2122
#[path = "api/openssl.rs"]
2223
mod openssl;
2324

@@ -51,6 +52,7 @@ fn real_world_system_tests() {
5152

5253
let high_level_cli = test_each_site(tests.sites.iter(), high_level_cli, "cli");
5354
let ffi = test_each_site(tests.sites.iter(), ffi::ffi, "ffi");
55+
#[cfg(not(windows))]
5456
let openssl = test_each_site(tests.sites.iter(), openssl::openssl, "openssl");
5557

5658
let verifier = ServerVerifier::new(
@@ -64,15 +66,22 @@ fn real_world_system_tests() {
6466
.unwrap();
6567

6668
let rustls_results = test_each_site(tests.sites.iter(), verifier, "rustls");
67-
68-
for ((((site, high), rustls), ffi), openssl) in tests
69+
let iter = tests
6970
.sites
7071
.iter()
7172
.zip(high_level_cli.iter())
7273
.zip(rustls_results.iter())
73-
.zip(ffi.iter())
74-
.zip(openssl.iter())
75-
{
74+
.zip(ffi.iter());
75+
76+
#[cfg(not(windows))]
77+
let iter = iter.zip(openssl.iter());
78+
79+
for cases in iter {
80+
#[cfg(windows)]
81+
let (((site, high), rustls), ffi) = cases;
82+
#[cfg(not(windows))]
83+
let ((((site, high), rustls), ffi), openssl) = cases;
84+
7685
assert!(
7786
high == rustls || *high == rustls.expired_as_revoked(),
7887
"site {site:?} revocation result disagrees between high-level API ({high:?}) and rustls verifier ({rustls:?})"
@@ -81,6 +90,7 @@ fn real_world_system_tests() {
8190
high == ffi,
8291
"site {site:?} revocation result disagrees between high-level API ({high:?}) and FFI API ({ffi:?})"
8392
);
93+
#[cfg(not(windows))]
8494
assert!(
8595
high == openssl,
8696
"site {site:?} revocation result disagrees between high-level API ({high:?}) and OpenSSL API ({openssl:?})"

0 commit comments

Comments
 (0)