diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7364c98c..4f5f6f6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,9 +31,8 @@ jobs: name: swifttests uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: - enable_windows_checks: false - linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}]" linux_env_vars: SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_BENCHMARKING=1 + linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}]" linux_pre_build_command: "apt-get update && apt-get install -y libjemalloc-dev" linux_build_command: > swift test --configuration release; @@ -41,6 +40,19 @@ jobs: basename=$(basename "$filename" .swift) swift run --configuration release ${basename} done + windows_env_vars: SWIFT_HOMOMORPHIC_ENCRYPTION_ENABLE_BENCHMARKING=1 + windows_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}]" + # swift test --configuration release; + # $filenames = Get-ChildItem -Path Snippets\*.swift -Name -Recurse; + # $filenames = Get-ChildItem -Path Snippets\* -Include *.swift -Name -Recurse; + # ^-- didn't work + windows_build_command: > + swift test --configuration release; + $swiftFiles = Get-ChildItem -Path .\Snippets -Include *.swift -Recurse; + foreach ($file in $swiftFiles) { + $basename = [System.IO.Path]::GetFileNameWithoutExtension($file.FullName); + swift run --configuration release $basename; + } pre-commit: timeout-minutes: 1 runs-on: ubuntu-22.04 diff --git a/Package.resolved b/Package.resolved index fab18367..d4b60126 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "3b554910bbc76ac563097effe5ba38eb7a8f36f6260a82637bbbb208737f4735", + "originHash" : "7001688638978137ef459f510bc9e09bee7ef6a9c3bd6ab4fc1c2222dd86ebad", "pins" : [ { "identity" : "swift-algorithms", @@ -15,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser.git", "state" : { - "revision" : "309a47b2b1d9b5e991f36961c983ecec72275be3", - "version" : "1.6.1" + "revision" : "41982a3656a71c768319979febd796c6fd111d5c", + "version" : "1.5.0" } }, { @@ -24,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-asn1.git", "state" : { - "revision" : "f70225981241859eb4aa1a18a75531d26637c8cc", - "version" : "1.4.0" + "revision" : "ae33e5941bb88d88538d0a6b19ca0b01e6c76dcf", + "version" : "1.3.1" } }, { @@ -33,8 +33,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-async-algorithms.git", "state" : { - "revision" : "042e1c4d9d19748c9c228f8d4ebc97bb1e339b0b", - "version" : "1.0.4" + "revision" : "2773d4125311133a2f705ec374c363a935069d45", + "version" : "1.1.0" } }, { @@ -42,8 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-collections.git", "state" : { - "revision" : "8c0c0a8b49e080e54e5e328cc552821ff07cd341", - "version" : "1.2.1" + "revision" : "7b847a3b7008b2dc2f47ca3110d8c782fb2e5c7e", + "version" : "1.3.0" } }, { @@ -51,8 +51,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-crypto.git", "state" : { - "revision" : "95ba0316a9b733e92bb6b071255ff46263bbe7dc", - "version" : "3.15.1" + "revision" : "a6ce32a18b81b04ce7e897d1d98df6eb2da04786", + "version" : "3.12.2" } }, { @@ -60,8 +60,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-log.git", "state" : { - "revision" : "ce592ae52f982c847a4efc0dd881cc9eb32d29f2", - "version" : "1.6.4" + "revision" : "3d8596ed08bd13520157f0355e35caed215ffbfa", + "version" : "1.6.3" } }, { @@ -69,8 +69,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-numerics", "state" : { - "revision" : "0c0290ff6b24942dadb83a929ffaaa1481df04a2", - "version" : "1.1.1" + "revision" : "e0ec0f5f3af6f3e4d5e7a19d2af26b481acb6ba8", + "version" : "1.0.3" } }, { @@ -78,8 +78,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-protobuf", "state" : { - "revision" : "2547102afd04fe49f1b286090f13ebce07284980", - "version" : "1.31.1" + "revision" : "c169a5744230951031770e27e475ff6eefe51f9d", + "version" : "1.33.3" } } ], diff --git a/Package.swift b/Package.swift index 59ac3c97..0bbb1c37 100644 --- a/Package.swift +++ b/Package.swift @@ -213,16 +213,6 @@ let package = Package( "HomomorphicEncryptionProtobuf", "_TestUtilities", ], swiftSettings: executableSettings), - .testTarget( - name: "PIRGenerateDatabaseTests", - dependencies: ["PIRGenerateDatabase", - "_TestUtilities", - .product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings), - .testTarget( - name: "PIRProcessDatabaseTests", - dependencies: ["PIRProcessDatabase", - "_TestUtilities", - .product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings), .testTarget( name: "PrivateInformationRetrievalTests", dependencies: [ @@ -245,6 +235,23 @@ let package = Package( ], swiftSettings: executableSettings), ]) +// Workaround SwiftPM's attempt to link in executables which does not work on all +// platforms. +#if !os(Windows) +package.targets.append(contentsOf: [ + .testTarget( + name: "PIRGenerateDatabaseTests", + dependencies: ["PIRGenerateDatabase", + "_TestUtilities", + .product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings), + .testTarget( + name: "PIRProcessDatabaseTests", + dependencies: ["PIRProcessDatabase", + "_TestUtilities", + .product(name: "Numerics", package: "swift-numerics")], swiftSettings: executableSettings), +]) +#endif + // MARK: - Benchmarks var enableBenchmarking: Bool { diff --git a/Snippets/HomomorphicEncryption/BasicsSnippet.swift b/Snippets/HomomorphicEncryption/BasicsSnippet.swift index e8050779..9c02495a 100644 --- a/Snippets/HomomorphicEncryption/BasicsSnippet.swift +++ b/Snippets/HomomorphicEncryption/BasicsSnippet.swift @@ -80,3 +80,5 @@ precondition(decoded == [8, 5, 12, 12, 15, 0, 8, 5]) // plaintext to any observer. The observed value in this case is zero. try sum -= sum precondition(sum.isTransparent()) + +preconditionFailure()