Skip to content
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

Merged
merged 59 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
c4d1179
Create composable action that helps set up iOS dependencies
timkimadobe Aug 8, 2024
04c8d2a
Create reusable workflow for iOS build and test checks for PR validation
timkimadobe Aug 8, 2024
f8613b5
Add flags for jobs to run
timkimadobe Aug 8, 2024
c6e3794
Create custom command build and test workflow
timkimadobe Aug 8, 2024
519064c
Update repo and branch to adobe main
timkimadobe Aug 8, 2024
e66e41d
Rename directory and workflow to be platform specific
timkimadobe Oct 30, 2024
213073a
Update title
timkimadobe Oct 30, 2024
61169a4
Update action versions to latest
timkimadobe Oct 30, 2024
23a5079
Testing calling remote action directly
timkimadobe Oct 30, 2024
4cea9e8
TEST: using remote composite action
timkimadobe Nov 5, 2024
3e673cd
Remove outdated input workflow_tag
timkimadobe Nov 5, 2024
ae10e89
Update all steps to use remote dependency setup composite action
timkimadobe Nov 5, 2024
402a665
Remove branch conditionals on job steps to allow caller repos to cont…
timkimadobe Nov 5, 2024
97181e6
TEST: add support for matrix device and os
timkimadobe Nov 5, 2024
1ec45a7
Update iOS dependencies action to better handle explicit save step ba…
timkimadobe Nov 5, 2024
6c46355
Add quotes to handle spaces in device names
timkimadobe Nov 5, 2024
54b8614
Fix missing if checks for job steps to run
timkimadobe Nov 5, 2024
4d2eac2
Update inputs for test device matrix to have defaults and non-mandato…
timkimadobe Nov 5, 2024
b65cefc
Update custom command workflow to use composable action and optional …
timkimadobe Nov 5, 2024
8c157da
Add logic to run matrix without validation if validation is not used
timkimadobe Nov 5, 2024
36bcd3b
try different bool check
timkimadobe Nov 5, 2024
2519ff0
Test using custom command
timkimadobe Nov 6, 2024
f9b3b05
Fix input names
timkimadobe Nov 6, 2024
fa2b56d
Test splitting actions into smaller workflows
timkimadobe Nov 6, 2024
53af8ee
Add names to custom command workflow jobs
timkimadobe Nov 6, 2024
514a58b
Add names to ios build and test workflow
timkimadobe Nov 6, 2024
4073275
Add matrix device and os info to name
timkimadobe Nov 6, 2024
fd74a5b
Update validate code job name
timkimadobe Nov 6, 2024
187a509
Remove fluff from job names
timkimadobe Nov 6, 2024
a9d9ea1
Try combining into single step
timkimadobe Nov 6, 2024
e6a7c4f
Test combining into single step
timkimadobe Nov 6, 2024
e719152
Update default matrix values
timkimadobe Nov 6, 2024
2c02a81
try using include instead
timkimadobe Nov 6, 2024
ef3472f
Update defaults
timkimadobe Nov 6, 2024
7901c09
Update to handle default matrix values
timkimadobe Nov 6, 2024
7ea19df
Clean up code and update names
timkimadobe Nov 6, 2024
907898e
Remove outdated if check
timkimadobe Nov 6, 2024
3d9d190
Add tvOS integration test step
timkimadobe Nov 6, 2024
60801a2
Test using codecov action
timkimadobe Nov 6, 2024
9d386bf
Explicitly pass token
timkimadobe Nov 6, 2024
9844fd1
Try passing secrets using inherit
timkimadobe Nov 6, 2024
8826545
Try specifying yaml path
timkimadobe Nov 6, 2024
c4e9710
Add verbose output for debugging
timkimadobe Nov 6, 2024
7ab55fa
Test passing directory
timkimadobe Nov 6, 2024
f475618
disable test run - only codecov
timkimadobe Nov 6, 2024
1276c6d
Fix pass through directory
timkimadobe Nov 7, 2024
d8df135
Reduce matrix runner parallelism to 1
timkimadobe Nov 7, 2024
3a4cff3
Test wildcard xcresult
timkimadobe Nov 7, 2024
c5c5c77
try moving to dervieddata folder
timkimadobe Nov 7, 2024
6da50be
test different directory
timkimadobe Nov 7, 2024
f374766
test ls
timkimadobe Nov 7, 2024
e94e87f
update to run test
timkimadobe Nov 7, 2024
549a8c5
Remove codecov directory input
timkimadobe Nov 7, 2024
f49410f
Create toggle for enabling codecov with default to true
timkimadobe Nov 7, 2024
00c7d83
Apply production configuration values
timkimadobe Nov 7, 2024
759b74c
Merge branch 'main' into ios-circleci-to-github
timkimadobe Nov 8, 2024
58fee35
Update workflow README with iOS build and test workflow requirements
timkimadobe Nov 8, 2024
7eb0a4d
Update build and test Makefile docs for matrix compatibility
timkimadobe Nov 8, 2024
2dcd4b8
Update iOS release workflow README
timkimadobe Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/actions/setup-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Setup Dependencies"
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, updated!

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
Copy link
Contributor

@praveek praveek Aug 19, 2024

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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') }}
223 changes: 223 additions & 0 deletions .github/workflows/ios-build-and-test.yml
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
Copy link
Contributor

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.

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')
Copy link
Contributor

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?

Copy link
Contributor

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


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
67 changes: 67 additions & 0 deletions .github/workflows/ios-custom-command-build-and-test.yml
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 }}