Skip to content

Start using Github Actions#53

Merged
dfed merged 2 commits into
mainfrom
dfed--github-actions
Mar 8, 2022
Merged

Start using Github Actions#53
dfed merged 2 commits into
mainfrom
dfed--github-actions

Conversation

@dfed

@dfed dfed commented Mar 7, 2022

Copy link
Copy Markdown
Owner

Resolves #51. This migration was heavily inspired by square/Valet#256

All the new jobs have been listed as required, and the Travis CI job has been removed entirely:
image

@dfed dfed force-pushed the dfed--github-actions branch 4 times, most recently from 45a3b78 to ecc937f Compare March 7, 2022 23:28
Comment thread Scripts/build.swift
switch self {
case .iOS_12:
return "platform=iOS Simulator,OS=12.2,name=iPad Pro (12.9-inch) (3rd generation)"
return "platform=iOS Simulator,OS=12.4,name=iPad Pro (12.9-inch) (3rd generation)"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub actions has different simulators pre-installed than Travis did, so we update them as part of this PR

Comment thread Scripts/build.swift
enum Platform: String, CaseIterable, CustomStringConvertible {
case iOS_12
case iOS_13
case iOS_14

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while I was here I added support for testing on iOS 14. I should add iOS 15 too but... for another day

@dfed dfed force-pushed the dfed--github-actions branch 2 times, most recently from eb60ecf to 239eaf0 Compare March 8, 2022 01:15
Comment thread Scripts/build.swift

try execute(commandPath: "/usr/bin/swift", arguments: ["package", "generate-xcodeproj", "--output=generated/"])

// The generate-xcodeproj command has a bug where the test deployment target is above the minimum deployment target for the project. Fix it with sed.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is absurd, but it works.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yikes

@@ -0,0 +1,24 @@
#!/bin/bash -l

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very similar to a file with the same name in Valet. Thank you @NickEntin for figuring out this absurdity.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha these two lines took me so long to figure out:

.../Xcode_11.7.app/.../iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime ...
.../Xcode_10.3.app/.../iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime ...

Because, you know, why not mix things up

@dfed dfed force-pushed the dfed--github-actions branch 3 times, most recently from 0f6bb62 to 69fdb06 Compare March 8, 2022 01:45
Comment thread .travis.yml
- bash <(curl -s https://codecov.io/bash) -J '^CADCacheAdvance$' -D .build/derivedData/macOS_10_15 -t 8344b011-6b2a-4b3d-a573-eaf49684318e

- osx_image: xcode11.2
env: ACTION="swift-package";PLATFORMS="watchOS_5,watchOS_6";

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that we are no longer testing on watchOS 5. Github Actions requires support for Xcode 10 in order to get access to a watchOS 5 simulator. Not worth the effort to support that old an Xcode version when we've never seen a failure specific to watchOS, let alone watchOS 5.

@dfed dfed force-pushed the dfed--github-actions branch from 69fdb06 to 082c375 Compare March 8, 2022 01:47
@dfed dfed requested review from bachand and fdiaz March 8, 2022 02:19
@dfed dfed marked this pull request as ready for review March 8, 2022 02:19
@dfed dfed requested a review from NickEntin March 8, 2022 02:19
@dfed dfed mentioned this pull request Mar 8, 2022
Comment thread .github/workflows/ci.yml
on:
push:
branches:
- main

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart, I might want to incorporate this into SwiftInspector to reduce usage of CI on PRs

Comment thread .github/workflows/ci.yml
pod-lint:
name: Pod Lint
runs-on: macOS-10.15
steps:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting approach, I've went with the approach of setting things once and then executing multiple steps rather than having multiple jobs. Both approaches work but this needs to checkout and bundle install multiple times which feels wasteful?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take another look at SwiftInspector. I'm down to make this more efficient, but I'm also not paying for the inefficiency here. Can be a future pass.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually went ahead and took a look, it's possible to have dependent jobs which I think would be the best of both worlds https://docs.github.com/en/actions/using-workflows/advanced-workflow-features#creating-dependent-jobs

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look like the needs API makes the dependent jobs run on the same machine per #55 😞

Comment thread Scripts/build.swift

try execute(commandPath: "/usr/bin/swift", arguments: ["package", "generate-xcodeproj", "--output=generated/"])

// The generate-xcodeproj command has a bug where the test deployment target is above the minimum deployment target for the project. Fix it with sed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yikes

@dfed dfed merged commit b2b3393 into main Mar 8, 2022
@dfed dfed deleted the dfed--github-actions branch March 8, 2022 17:25
@bachand

bachand commented Mar 9, 2022

Copy link
Copy Markdown
Collaborator

I will defer to @fdiaz's review. Thanks for fixing completing this migration @dfed .

@dfed dfed mentioned this pull request Mar 9, 2022
@bachand bachand mentioned this pull request Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move off of Travis CI

4 participants