swift-playdate-examples icon indicating copy to clipboard operation
swift-playdate-examples copied to clipboard

Add SwiftPM GitHub CI support

Open Kyle-Ye opened this issue 1 year ago • 5 comments

I have tested this on my fork. You can check it here

image

Kyle-Ye avatar Mar 13 '24 08:03 Kyle-Ye

I'm also considering adding Xcode CI in this PR. But I encounter some strange issue when using xcodebuild to build the example target.

xcodebuild build \
            -scheme Life \
            -configuration Release \
            -skipMacroValidation -skipPackagePluginValidation \
            -destination "platform=macos"

The error message is as following

xcodebuild: error: Could not resolve package dependencies:
  Invalid manifest (compiled with: ["/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-03-07-a.xctoolchain/usr/bin/swiftc", "-vfsoverlay", "/var/folders/hs/g5q9gn6d5tx6_3bxmq1pj0rw0000gp/T/TemporaryDirectory.pY2hLP/vfs.yaml", "-L", "/Applications/Xcode-15.3.0.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/Applications/Xcode-15.3.0.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-target", "arm64-apple-macos13.0", "-sdk", "/Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk", "-swift-version", "5", "-I", "/Applications/Xcode-15.3.0.app/Contents/SharedFrameworks/SwiftPM.framework/SharedSupport/ManifestAPI", "-sdk", "/Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk", "-package-description-version", "5.9.0", "-Xfrontend", "-serialize-diagnostics-path", "-Xfrontend", "/Users/kyle/Library/Caches/org.swift.swiftpm/manifests/ManifestLoading/life.dia", "/Users/kyle/Developer/Playdate/swift-playdate-examples/Examples/Life/Package.swift", "-disallow-use-new-driver", "-o", "/var/folders/hs/g5q9gn6d5tx6_3bxmq1pj0rw0000gp/T/TemporaryDirectory.gc8PVm/life-manifest"])
<unknown>:0: warning: legacy driver is now deprecated; consider avoiding specifying '-disallow-use-new-driver'
<unknown>:0: error: unable to execute command: <unknown>

I can't solve it in a short time. So I guess we can add the SwiftPM CI first which at least provides a layer of promise that new PR will not break SwiftPM build.

Kyle-Ye avatar Mar 13 '24 08:03 Kyle-Ye

@DougGregor I'm not sure about the Swift project's policy regarding CI with Github Actions currently, could you chime in?

rauhul avatar Mar 13 '24 18:03 rauhul

@DougGregor I'm not sure about the Swift project's policy regarding CI with Github Actions currently, could you chime in?

IIRC, we should ask @shahmishal for Swift CI related thing

Related Post: https://forums.swift.org/t/dropping-support-for-swift-ci-test-and-merge-in-favor-of-auto-merge-feature-on-github/68297

Kyle-Ye avatar Mar 13 '24 18:03 Kyle-Ye

Apple has GitHub actions disabled at the organization level, so running for PRs won't have any effect - individuals can enable GitHub actions on their own forks if they are so inclined. ci.swift.org is used for testing most other swift-family projects.

shahmishal avatar Mar 15 '24 03:03 shahmishal

Apple has GitHub actions disabled at the organization level, so running for PRs won't have any effect - individuals can enable GitHub actions on their own forks if they are so inclined. ci.swift.org is used for testing most other swift-family projects.

Is there any existing CI workflow on ci.swift.org for this repo. Looks like we did not run swift test before a merge currently.

Do we need to add such CI to ci.swift.org for this repo or enable GitHub action for this repo? @rauhul

Kyle-Ye avatar Mar 15 '24 04:03 Kyle-Ye