-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS CircleCI to GitHub Actions reusable workflow conversion #67
Conversation
@@ -0,0 +1,48 @@ | |||
name: "Setup Dependencies" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setup-action is iOS specific. Can you rename it accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, updated!
with: | ||
path: | | ||
Pods | ||
SampleApps/TestApp/Pods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path changes for each repo. Can we exclude it from the cache for now and consider including it later if it becomes a concern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, removed
uses: actions/[email protected] | ||
with: | ||
repository: adobe/aepsdk-commons | ||
ref: main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not default to main.
Thanks for the PR. I have a few more suggestions
|
test-ios-integration: | ||
runs-on: macos-latest | ||
needs: validate-code | ||
if: inputs.run_test_ios_integration && (inputs.github_ref == 'refs/heads/main' || inputs.github_ref == 'refs/heads/staging') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding these checks && (inputs.github_ref == 'refs/heads/main' || inputs.github_ref == 'refs/heads/staging')
makes it impossible to override the default behavior. Can we instead rely solely on a boolean value and move these checks to the caller repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment for build_xcframework_and_app
Update cache action to latest 4.1.2 Update save cache actions to explicitly use the save action Update titles to sentence case
Add caching logic Add workflow_tag input variable
Update all inputs to use hyphen for consistency Remove github ref input and use the value auto populated in the env since it is the same value
…rol this behavior
…sed on cache hit result
…ry values also add descriptions of usage and formatting Update test step run to false for all cases Apply matrix strategy for all test steps Use branch ref instead of tag for testing Test using the custom command instead of rewritten job steps
Test different yaml path using current working directory
Apply codecov flag and secrets passing to all test jobs
Remove codecov yaml path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @praveek! Updated based on feedback - please let me know what you think
@@ -0,0 +1,48 @@ | |||
name: "Setup Dependencies" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, updated!
with: | ||
path: | | ||
Pods | ||
SampleApps/TestApp/Pods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, removed
with: | ||
ios-device-names: ${{ inputs.ios-device-names }} | ||
ios-versions: ${{ inputs.ios-versions }} | ||
command: make unit-test-ios |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, added Codecov support for each test case with some caveats - please see the main PR description under Questions for reviewers section for more details. Also added an example of the Codecov enabled run under Example runs section
jobs: | ||
validate-code: | ||
name: Validate Code | ||
uses: timkimadobe/aepsdk-commons/.github/workflows/ios-validate-code.yml@ios-circleci-to-github |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated! Using the major version aligned tag: gha-ios-5.0.0
@timkimadobe Regarding Codecov, I noticed there is a directory argument that allows specifying custom directories. Additionally, I saw an issue where Codecov v4 does not support .xcresult-based tests. If this is the case, could you try reverting to v3 to see if it works for our use case? |
Everything else looks good. However, the workflows contain several internal references using specific tags. Can you also create a script and release action for this repo that will find all references like the one below and replace them with the tag we are creating?
|
Based on a test run, the v4 Codecov action looks like it does support code coverage for tests not by using the
But it also looks like while it does support coverage in this way out of the box, this plugin doesn't currently support overriding the default derived data directory (so I don't think using the Given this I was thinking the most convenient usage would be to simply align with the default DerivedData directory used by the Xcode plugin, and if we need the .xcresult in other CI steps (ex: upload artifacts, etc), we can copy it to the desired directory? For reference, here is an example run using the default DerivedData directory with successfully uploaded coverage: https://github.com/timkimadobe/aepsdk-edge-ios/actions/runs/11714920884/job/32630451484
|
Yes, I think that sounds good - I've created a separate PR for these changes: |
Questions for reviewers
For the standardized build and test workflow:
Important
I couldn't figure out how to get custom derived data paths working with the Codecov action, so Makefiles must remove the
-resultBundlePath
flag when usingxcodebuild test
. Ex:-resultBundlePath build/reports/iosFunctionalResults.xcresult
. Is this acceptable?DerivedData folder: /Users/runner/Library/Developer/Xcode/DerivedData
: https://github.com/codecov/codecov-action?tab=readme-ov-file#argumentsinput:
options for passing their specific flags to the CLI (this input explosion would be the same if we passed options to the Codecov Action as well): https://docs.codecov.com/docs/the-codecov-cliDescription
Note
See #64 for additional context on reusable workflows
This PR:
The goal is to reduce the amount of workflow maintenance work that needs to be done across repos (ex: action version upgrades, runner changes, iOS simulator updates, etc).
There are three new files:
ios-build-and-test.yml
Build and test (CircleCI converted to GitHub actions reusable workflow) - which has the standard PR check make commands
.github/actions/ios-setup-dependencies-action/action.yml
false
)ios-custom-command-build-and-test.yml
This is a modularized workflow that handles:
IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}"
Note
This modular workflow is used by
ios-build-and-test.yml
to avoid repeating a lot of the same setup code, and it can also be called by repos directly if they need to use non-standardmake
commands.ios-validate-code.yml
Validates the code by using the command
make lint
Example caller repo usage:
Example runs
Example run (with matrix using both iOS and tvOS paths): https://github.com/timkimadobe/aepsdk-edge-ios/actions/runs/11695962501
Example run with Codecov enabled: https://github.com/timkimadobe/aepsdk-edge-ios/actions/runs/11714920884/job/32630451484
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: