From 6ecbf72ae94f6fe468aa74df1f01c20e9bdddb64 Mon Sep 17 00:00:00 2001 From: Nate Cook Date: Mon, 9 Jun 2025 15:34:30 -0500 Subject: [PATCH 1/2] Fix issue with test availability in Linux --- .github/workflows/pull_request.yml | 17 +++++++++-------- Tests/ExampleParserTests/TestQOI.swift | 13 ++++++++----- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 3cca3d3..c07e9d1 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -20,14 +20,15 @@ jobs: curl -sL https://raw.githubusercontent.com/apple/swift-mmio/refs/heads/main/.swift-format -o .swift-format-mmio diff .swift-format .swift-format-mmio -# tests: -# name: Test -# uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main -# with: -# macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.0\"}, {\"xcode_version\": \"16.1\"}, {\"xcode_version\": \"16.2\"}, {\"xcode_version\": \"16.3\"}]" -# linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}, {\"swift_version\": \"nightly-main\"}, {\"swift_version\": \"nightly-6.1\"}, {\"swift_version\": \"nightly-6.2\"}]" -# windows_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}, {\"swift_version\": \"nightly\"}, {\"swift_version\": \"nightly-6.1\"}]" -# enable_macos_checks: true + tests: + name: Test + uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main + with: + macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.0\"}, {\"xcode_version\": \"16.1\"}, {\"xcode_version\": \"16.2\"}, {\"xcode_version\": \"16.3\"}]" + linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}, {\"swift_version\": \"nightly-main\"}, {\"swift_version\": \"nightly-6.1\"}]" + windows_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}, {\"swift_version\": \"nightly\"}, {\"swift_version\": \"nightly-6.1\"}]" + enable_macos_checks: false + enable_windows_checks: false soundness: name: Soundness diff --git a/Tests/ExampleParserTests/TestQOI.swift b/Tests/ExampleParserTests/TestQOI.swift index b67af7e..00bb257 100644 --- a/Tests/ExampleParserTests/TestQOI.swift +++ b/Tests/ExampleParserTests/TestQOI.swift @@ -15,16 +15,18 @@ import Testing #if canImport(AppKit) import AppKit +#else +import Foundation #endif struct QOITests { @Test(arguments: ["tricolor", "antelope"]) func parseImage(fileName: String) throws { let qoi = try #require(Self.getQOIPixels(testFileName: fileName)) - if #available(macOS 10.0, *) { - let png = try #require(Self.getPNGPixels(testFileName: fileName)) - #expect(png == qoi) - } +#if canImport(AppKit) + let png = try #require(Self.getPNGPixels(testFileName: fileName)) + #expect(png == qoi) +#endif } static func getQOIPixels(testFileName: String) -> Data? { @@ -36,7 +38,7 @@ struct QOITests { }.pixels } - @available(macOS 10.0, *) +#if canImport(AppKit) static func getPNGPixels(testFileName: String) -> Data? { guard let imageData = testData(named: "PNG/\(testFileName).png"), let image = NSImage(data: imageData) @@ -53,4 +55,5 @@ struct QOITests { } return nil } +#endif } From 5d96eac8e560126848c97536b09341704c20bcaa Mon Sep 17 00:00:00 2001 From: Nate Cook Date: Mon, 9 Jun 2025 15:43:49 -0500 Subject: [PATCH 2/2] Skip code of conduct in unacceptable language check --- .unacceptablelanguageignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .unacceptablelanguageignore diff --git a/.unacceptablelanguageignore b/.unacceptablelanguageignore new file mode 100644 index 0000000..fb9dc39 --- /dev/null +++ b/.unacceptablelanguageignore @@ -0,0 +1 @@ +CODE_OF_CONDUCT.md