-
Notifications
You must be signed in to change notification settings - Fork 9
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
Changes from 5 commits
c4d1179
04c8d2a
f8613b5
c6e3794
519064c
e66e41d
213073a
61169a4
23a5079
4cea9e8
3e673cd
ae10e89
402a665
97181e6
1ec45a7
6c46355
54b8614
4d2eac2
b65cefc
8c157da
36bcd3b
2519ff0
f9b3b05
fa2b56d
53af8ee
514a58b
4073275
fd74a5b
187a509
a9d9ea1
e6a7c4f
e719152
2c02a81
ef3472f
7901c09
7ea19df
907898e
3d9d190
60801a2
9d386bf
9844fd1
8826545
c4e9710
7ab55fa
f475618
1276c6d
d8df135
3a4cff3
c5c5c77
6da50be
f374766
e94e87f
549a8c5
f49410f
00c7d83
759b74c
58fee35
7eb0a4d
2dcd4b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: "Setup Dependencies" | ||
description: "Checkout and install dependencies" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Restore Gemfile Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: vendor/bundle | ||
key: gems-${{ runner.os }}-${{ hashFiles('**/Gemfile.lock') }} | ||
|
||
- name: Configure Bundler Path and Verify Cocoapods Version | ||
run: | | ||
bundle config set path 'vendor/bundle' | ||
bundle check || bundle install | ||
shell: bash | ||
|
||
- name: Save Gemfile Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: vendor/bundle | ||
key: gems-${{ runner.os }}-${{ hashFiles('**/Gemfile.lock') }} | ||
|
||
- name: Restore CocoaPods Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
Pods | ||
SampleApps/TestApp/Pods | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Yes, removed |
||
~/.cocoapods | ||
key: cocoapods-cache-v6-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('**/Podfile.lock') }} | ||
restore-keys: | | ||
cocoapods-cache-v6-${{ runner.os }}-${{ github.ref }} | ||
cocoapods-cache-v6 | ||
|
||
- name: Install CocoaPods | ||
run: make ci-pod-install | ||
shell: bash | ||
|
||
- name: Save CocoaPods Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
Pods | ||
SampleApps/TestApp/Pods | ||
~/.cocoapods | ||
key: cocoapods-cache-v6-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('**/Podfile.lock') }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,223 @@ | ||
name: Build and Test (iOS) | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
device_name: | ||
required: true | ||
type: string | ||
os_version: | ||
required: true | ||
type: string | ||
github_ref: | ||
required: true | ||
type: string | ||
# Flags for jobs to run | ||
run_test_ios_unit: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_test_ios_functional: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_test_ios_integration: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_test_tvos_unit: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_test_tvos_functional: | ||
required: false | ||
type: boolean | ||
default: true | ||
run_build_xcframework_and_app: | ||
required: false | ||
type: boolean | ||
default: true | ||
|
||
jobs: | ||
validate-code: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
|
||
- name: Checkout actions from aepsdk-commons | ||
uses: actions/[email protected] | ||
with: | ||
repository: adobe/aepsdk-commons | ||
ref: main | ||
path: .github/aepsdk-commons | ||
sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory | ||
|
||
- name: Setup Dependencies | ||
uses: ./.github/aepsdk-commons/.github/actions/setup-action | ||
|
||
- name: Remove files from aepsdk-commons | ||
run: rm -rf ./github/aepsdk-commons | ||
|
||
- name: Lint Source Code | ||
run: make lint | ||
|
||
test-ios-unit: | ||
runs-on: macos-latest | ||
needs: validate-code | ||
if: inputs.run_test_ios_unit | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
|
||
- name: Checkout actions from aepsdk-commons | ||
uses: actions/[email protected] | ||
with: | ||
repository: adobe/aepsdk-commons | ||
ref: main | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not default to main. |
||
path: .github/aepsdk-commons | ||
sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory | ||
|
||
- name: Setup Dependencies | ||
uses: ./.github/aepsdk-commons/.github/actions/setup-action | ||
|
||
- name: Remove files from aepsdk-commons | ||
run: rm -rf ./github/aepsdk-commons | ||
|
||
- name: Run iOS Unit Tests | ||
run: make unit-test-ios | ||
|
||
test-ios-functional: | ||
runs-on: macos-latest | ||
needs: validate-code | ||
if: inputs.run_test_ios_functional | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
|
||
- name: Checkout actions from aepsdk-commons | ||
uses: actions/[email protected] | ||
with: | ||
repository: adobe/aepsdk-commons | ||
ref: main | ||
path: .github/aepsdk-commons | ||
sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory | ||
|
||
- name: Setup Dependencies | ||
uses: ./.github/aepsdk-commons/.github/actions/setup-action | ||
|
||
- name: Remove files from aepsdk-commons | ||
run: rm -rf ./github/aepsdk-commons | ||
|
||
- name: Run iOS Functional Tests | ||
run: make functional-test-ios | ||
|
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Adding these checks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar comment for |
||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
|
||
- name: Checkout actions from aepsdk-commons | ||
uses: actions/[email protected] | ||
with: | ||
repository: adobe/aepsdk-commons | ||
ref: main | ||
path: .github/aepsdk-commons | ||
sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory | ||
|
||
- name: Setup Dependencies | ||
uses: ./.github/aepsdk-commons/.github/actions/setup-action | ||
|
||
- name: Remove files from aepsdk-commons | ||
run: rm -rf ./github/aepsdk-commons | ||
|
||
- name: Run iOS Integration Tests | ||
run: make test-integration-upstream | ||
|
||
test-tvos-unit: | ||
runs-on: macos-latest | ||
needs: validate-code | ||
if: inputs.run_test_tvos_unit | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
|
||
- name: Checkout actions from aepsdk-commons | ||
uses: actions/[email protected] | ||
with: | ||
repository: adobe/aepsdk-commons | ||
ref: main | ||
path: .github/aepsdk-commons | ||
sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory | ||
|
||
- name: Setup Dependencies | ||
uses: ./.github/aepsdk-commons/.github/actions/setup-action | ||
|
||
- name: Remove files from aepsdk-commons | ||
run: rm -rf ./github/aepsdk-commons | ||
|
||
- name: Run tvOS Unit Tests | ||
run: make unit-test-tvos | ||
|
||
test-tvos-functional: | ||
runs-on: macos-latest | ||
needs: validate-code | ||
if: inputs.run_test_tvos_functional | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
|
||
- name: Checkout actions from aepsdk-commons | ||
uses: actions/[email protected] | ||
with: | ||
repository: adobe/aepsdk-commons | ||
ref: main | ||
path: .github/aepsdk-commons | ||
sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory | ||
|
||
- name: Setup Dependencies | ||
uses: ./.github/aepsdk-commons/.github/actions/setup-action | ||
|
||
- name: Remove files from aepsdk-commons | ||
run: rm -rf ./github/aepsdk-commons | ||
|
||
- name: Run tvOS Functional Tests | ||
run: make functional-test-tvos | ||
|
||
build_xcframework_and_app: | ||
runs-on: macos-latest | ||
needs: validate-code | ||
if: inputs.run_build_xcframework_and_app && (inputs.github_ref == 'refs/heads/main' || inputs.github_ref == 'refs/heads/staging') | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
|
||
- name: Checkout actions from aepsdk-commons | ||
uses: actions/[email protected] | ||
with: | ||
repository: adobe/aepsdk-commons | ||
ref: main | ||
path: .github/aepsdk-commons | ||
sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory | ||
|
||
- name: Setup Dependencies | ||
uses: ./.github/aepsdk-commons/.github/actions/setup-action | ||
|
||
- name: Remove files from aepsdk-commons | ||
run: rm -rf ./github/aepsdk-commons | ||
|
||
- name: Build XCFramework | ||
run: make archive | ||
|
||
- name: Build Test App | ||
run: make build-app |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Custom Command Build and Test (iOS) | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
device_name: | ||
required: true | ||
type: string | ||
os_version: | ||
required: true | ||
type: string | ||
github_ref: | ||
required: true | ||
type: string | ||
command: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
validate-code: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
|
||
- name: Checkout actions from aepsdk-commons | ||
uses: actions/[email protected] | ||
with: | ||
repository: adobe/aepsdk-commons | ||
ref: main | ||
path: .github/aepsdk-commons | ||
sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory | ||
|
||
- name: Setup Dependencies | ||
uses: ./.github/aepsdk-commons/.github/actions/setup-action | ||
|
||
- name: Remove files from aepsdk-commons | ||
run: rm -rf ./github/aepsdk-commons | ||
|
||
- name: Lint Source Code | ||
run: make lint | ||
|
||
custom-command: | ||
runs-on: macos-latest | ||
needs: validate-code | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
|
||
- name: Checkout actions from aepsdk-commons | ||
uses: actions/[email protected] | ||
with: | ||
repository: adobe/aepsdk-commons | ||
ref: main | ||
path: .github/aepsdk-commons | ||
sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory | ||
|
||
- name: Setup Dependencies | ||
uses: ./.github/aepsdk-commons/.github/actions/setup-action | ||
|
||
- name: Remove files from aepsdk-commons | ||
run: rm -rf ./github/aepsdk-commons | ||
|
||
- name: Run ${{ inputs.command }} | ||
run: ${{ inputs.command }} |
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!