Skip to content

Commit 6cbb5cc

Browse files
committed
Enable Windows CI
1 parent 7534dda commit 6cbb5cc

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ concurrency:
1616
env:
1717
SWIFTLINT_VERSION: 0.57.0
1818
SWIFTFORMAT_VERSION: 0.54.6
19-
SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_BENCHMARKING: 1
2019
jobs:
2120
soundness:
2221
name: soundness
@@ -29,7 +28,7 @@ jobs:
2928
name: swifttests
3029
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
3130
with:
32-
enable_windows_checks: false
31+
linux_env_vars: "SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_BENCHMARKING=1"
3332
# TODO: remove 5.8 after https://github.com/swiftlang/github-workflows/pull/107
3433
linux_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}, {\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}]"
3534
linux_pre_build_command: "apt-get update && apt-get install -y libjemalloc-dev"
@@ -39,6 +38,19 @@ jobs:
3938
basename=$(basename "$filename" .swift)
4039
swift run --configuration release ${basename}
4140
done
41+
# TODO: remove 5.8 after https://github.com/swiftlang/github-workflows/pull/107
42+
windows_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}, {\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}]"
43+
# swift test --configuration release;
44+
# $filenames = Get-ChildItem -Path Snippets\*.swift -Name -Recurse;
45+
# $filenames = Get-ChildItem -Path Snippets\* -Include *.swift -Name -Recurse;
46+
# ^-- didn't work
47+
windows_build_command: >
48+
$filenames = Get-ChildItem -Path .\Snippets\*.swif -Recurse -Name;
49+
Write-Host "filenames: $filenames";
50+
foreach ($filename in $filenames) {
51+
basename = $(basename "$filename" .swift)
52+
swift run --configuration release ${basename}
53+
}
4254
pre-commit:
4355
timeout-minutes: 1
4456
runs-on: ubuntu-22.04

Package.swift

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,6 @@ let package = Package(
190190
"HomomorphicEncryptionProtobuf",
191191
"_TestUtilities",
192192
], swiftSettings: executableSettings),
193-
.testTarget(
194-
name: "PIRGenerateDatabaseTests",
195-
dependencies: ["PIRGenerateDatabase",
196-
"_TestUtilities",
197-
.product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings),
198-
.testTarget(
199-
name: "PIRProcessDatabaseTests",
200-
dependencies: ["PIRProcessDatabase",
201-
"_TestUtilities",
202-
.product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings),
203193
.testTarget(
204194
name: "PrivateInformationRetrievalTests",
205195
dependencies: [
@@ -226,6 +216,23 @@ let package = Package(
226216
], swiftSettings: executableSettings),
227217
])
228218

219+
// Workaround SwiftPM's attempt to link in executables which does not work on all
220+
// platforms.
221+
#if !os(Windows)
222+
package.targets.append(contentsOf: [
223+
.testTarget(
224+
name: "PIRGenerateDatabaseTests",
225+
dependencies: ["PIRGenerateDatabase",
226+
"_TestUtilities",
227+
.product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings),
228+
.testTarget(
229+
name: "PIRProcessDatabaseTests",
230+
dependencies: ["PIRProcessDatabase",
231+
"_TestUtilities",
232+
.product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings),
233+
])
234+
#endif
235+
229236
// MARK: - Benchmarks
230237

231238
var enableBenchmarking: Bool {

0 commit comments

Comments
 (0)