Skip to content

Commit 23668ef

Browse files
committed
Enable Windows CI
1 parent 9e4c6c2 commit 23668ef

File tree

3 files changed

+48
-29
lines changed

3 files changed

+48
-29
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,28 @@ jobs:
3131
name: swifttests
3232
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
3333
with:
34-
enable_windows_checks: false
35-
linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}]"
3634
linux_env_vars: SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_BENCHMARKING=1
35+
linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}]"
3736
linux_pre_build_command: "apt-get update && apt-get install -y libjemalloc-dev"
3837
linux_build_command: >
3938
swift test --configuration release;
4039
for filename in $(find Snippets -name \*.swift); do
4140
basename=$(basename "$filename" .swift)
4241
swift run --configuration release ${basename}
4342
done
43+
windows_env_vars: SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_BENCHMARKING=1
44+
windows_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}]"
45+
# swift test --configuration release;
46+
# $filenames = Get-ChildItem -Path Snippets\*.swift -Name -Recurse;
47+
# $filenames = Get-ChildItem -Path Snippets\* -Include *.swift -Name -Recurse;
48+
# ^-- didn't work
49+
windows_build_command: >
50+
swift test --configuration release;
51+
$swiftFiles = Get-ChildItem -Path .\Snippets -Include *.swift -Recurse;
52+
foreach ($file in $swiftFiles) {
53+
$basename = [System.IO.Path]::GetFileNameWithoutExtension($file.FullName);
54+
swift run --configuration release $basename;
55+
}
4456
pre-commit:
4557
timeout-minutes: 1
4658
runs-on: ubuntu-22.04

Package.resolved

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

Package.swift

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,6 @@ let package = Package(
213213
"HomomorphicEncryptionProtobuf",
214214
"_TestUtilities",
215215
], swiftSettings: executableSettings),
216-
.testTarget(
217-
name: "PIRGenerateDatabaseTests",
218-
dependencies: ["PIRGenerateDatabase",
219-
"_TestUtilities",
220-
.product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings),
221-
.testTarget(
222-
name: "PIRProcessDatabaseTests",
223-
dependencies: ["PIRProcessDatabase",
224-
"_TestUtilities",
225-
.product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings),
226216
.testTarget(
227217
name: "PrivateInformationRetrievalTests",
228218
dependencies: [
@@ -245,6 +235,23 @@ let package = Package(
245235
], swiftSettings: executableSettings),
246236
])
247237

238+
// Workaround SwiftPM's attempt to link in executables which does not work on all
239+
// platforms.
240+
#if !os(Windows)
241+
package.targets.append(contentsOf: [
242+
.testTarget(
243+
name: "PIRGenerateDatabaseTests",
244+
dependencies: ["PIRGenerateDatabase",
245+
"_TestUtilities",
246+
.product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings),
247+
.testTarget(
248+
name: "PIRProcessDatabaseTests",
249+
dependencies: ["PIRProcessDatabase",
250+
"_TestUtilities",
251+
.product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings),
252+
])
253+
#endif
254+
248255
// MARK: - Benchmarks
249256

250257
var enableBenchmarking: Bool {

0 commit comments

Comments
 (0)