From c4d1179d1cea3f58a80b8f6083d1a43fd58d033c Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:37:00 -0700 Subject: [PATCH 01/58] Create composable action that helps set up iOS dependencies --- .github/actions/setup-action/action.yml | 48 +++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/actions/setup-action/action.yml diff --git a/.github/actions/setup-action/action.yml b/.github/actions/setup-action/action.yml new file mode 100644 index 00000000..900c43d7 --- /dev/null +++ b/.github/actions/setup-action/action.yml @@ -0,0 +1,48 @@ +name: "Setup Dependencies" +description: "Checkout and install dependencies" + +runs: + using: "composite" + steps: + - name: Restore Gemfile Cache + uses: actions/cache@v4.0.2 + 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/cache@v4.0.2 + with: + path: vendor/bundle + key: gems-${{ runner.os }}-${{ hashFiles('**/Gemfile.lock') }} + + - name: Restore CocoaPods Cache + uses: actions/cache@v4.0.2 + with: + path: | + Pods + SampleApps/TestApp/Pods + ~/.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/cache@v4.0.2 + with: + path: | + Pods + SampleApps/TestApp/Pods + ~/.cocoapods + key: cocoapods-cache-v6-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('**/Podfile.lock') }} From 04c8d2ae72a8da4321671846b053473394c53250 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:40:55 -0700 Subject: [PATCH 02/58] Create reusable workflow for iOS build and test checks for PR validation --- .github/workflows/ios-build-and-test.yml | 194 +++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 .github/workflows/ios-build-and-test.yml diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml new file mode 100644 index 00000000..a6a8cc9b --- /dev/null +++ b/.github/workflows/ios-build-and-test.yml @@ -0,0 +1,194 @@ +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 + +jobs: + validate-code: + runs-on: macos-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4.1.7 + + - name: Checkout actions from aepsdk-commons + uses: actions/checkout@v4.1.7 + 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 + + steps: + - name: Checkout Repository + uses: actions/checkout@v4.1.7 + + - name: Checkout actions from aepsdk-commons + uses: actions/checkout@v4.1.7 + 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 Unit Tests + run: make unit-test-ios + + test-ios-functional: + runs-on: macos-latest + needs: validate-code + + steps: + - name: Checkout Repository + uses: actions/checkout@v4.1.7 + + - name: Checkout actions from aepsdk-commons + uses: actions/checkout@v4.1.7 + 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.github_ref == 'refs/heads/main' || inputs.github_ref == 'refs/heads/staging' + + steps: + - name: Checkout Repository + uses: actions/checkout@v4.1.7 + + - name: Checkout actions from aepsdk-commons + uses: actions/checkout@v4.1.7 + 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 + + steps: + - name: Checkout Repository + uses: actions/checkout@v4.1.7 + + - name: Checkout actions from aepsdk-commons + uses: actions/checkout@v4.1.7 + 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 + + steps: + - name: Checkout Repository + uses: actions/checkout@v4.1.7 + + - name: Checkout actions from aepsdk-commons + uses: actions/checkout@v4.1.7 + 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.github_ref == 'refs/heads/main' || inputs.github_ref == 'refs/heads/staging' + + steps: + - name: Checkout Repository + uses: actions/checkout@v4.1.7 + + - name: Checkout actions from aepsdk-commons + uses: actions/checkout@v4.1.7 + 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 From f8613b5a995a0c71eb809bbc6584136b6b9753a3 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:54:53 -0700 Subject: [PATCH 03/58] Add flags for jobs to run --- .github/workflows/ios-build-and-test.yml | 61 +++++++++++++++++------- 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index a6a8cc9b..f093c26b 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -12,6 +12,31 @@ on: 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: @@ -24,8 +49,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: adobe/aepsdk-commons - ref: main + repository: timkimadobe/aepsdk-commons + ref: ios-reusable-workflows path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory @@ -41,6 +66,7 @@ jobs: test-ios-unit: runs-on: macos-latest needs: validate-code + if: inputs.run_test_ios_unit steps: - name: Checkout Repository @@ -49,8 +75,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: adobe/aepsdk-commons - ref: main + repository: timkimadobe/aepsdk-commons + ref: ios-reusable-workflows path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory @@ -66,6 +92,7 @@ jobs: test-ios-functional: runs-on: macos-latest needs: validate-code + if: inputs.run_test_ios_functional steps: - name: Checkout Repository @@ -74,8 +101,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: adobe/aepsdk-commons - ref: main + repository: timkimadobe/aepsdk-commons + ref: ios-reusable-workflows path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory @@ -91,7 +118,7 @@ jobs: test-ios-integration: runs-on: macos-latest needs: validate-code - if: inputs.github_ref == 'refs/heads/main' || inputs.github_ref == 'refs/heads/staging' + if: inputs.run_test_ios_integration && (inputs.github_ref == 'refs/heads/main' || inputs.github_ref == 'refs/heads/staging') steps: - name: Checkout Repository @@ -100,8 +127,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: adobe/aepsdk-commons - ref: main + repository: timkimadobe/aepsdk-commons + ref: ios-reusable-workflows path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory @@ -117,6 +144,7 @@ jobs: test-tvos-unit: runs-on: macos-latest needs: validate-code + if: inputs.run_test_tvos_unit steps: - name: Checkout Repository @@ -125,8 +153,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: adobe/aepsdk-commons - ref: main + repository: timkimadobe/aepsdk-commons + ref: ios-reusable-workflows path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory @@ -142,6 +170,7 @@ jobs: test-tvos-functional: runs-on: macos-latest needs: validate-code + if: inputs.run_test_tvos_functional steps: - name: Checkout Repository @@ -150,8 +179,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: adobe/aepsdk-commons - ref: main + repository: timkimadobe/aepsdk-commons + ref: ios-reusable-workflows path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory @@ -167,7 +196,7 @@ jobs: build_xcframework_and_app: runs-on: macos-latest needs: validate-code - if: inputs.github_ref == 'refs/heads/main' || inputs.github_ref == 'refs/heads/staging' + if: inputs.run_build_xcframework_and_app && (inputs.github_ref == 'refs/heads/main' || inputs.github_ref == 'refs/heads/staging') steps: - name: Checkout Repository @@ -176,8 +205,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: adobe/aepsdk-commons - ref: main + repository: timkimadobe/aepsdk-commons + ref: ios-reusable-workflows path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory From c6e3794526ded6613b620c5d2f52f19044878d64 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:57:21 -0700 Subject: [PATCH 04/58] Create custom command build and test workflow --- .../ios-custom-command-build-and-test.yml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/ios-custom-command-build-and-test.yml diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml new file mode 100644 index 00000000..50e53464 --- /dev/null +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -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/checkout@v4.1.7 + + - name: Checkout actions from aepsdk-commons + uses: actions/checkout@v4.1.7 + 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/checkout@v4.1.7 + + - name: Checkout actions from aepsdk-commons + uses: actions/checkout@v4.1.7 + 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 }} From 519064c6f72911ab16f1797b73d75ea90e3191b2 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:57:36 -0700 Subject: [PATCH 05/58] Update repo and branch to adobe main --- .github/workflows/ios-build-and-test.yml | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index f093c26b..bc2ceeb5 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -49,8 +49,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: timkimadobe/aepsdk-commons - ref: ios-reusable-workflows + repository: adobe/aepsdk-commons + ref: main path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory @@ -75,8 +75,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: timkimadobe/aepsdk-commons - ref: ios-reusable-workflows + repository: adobe/aepsdk-commons + ref: main path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory @@ -101,8 +101,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: timkimadobe/aepsdk-commons - ref: ios-reusable-workflows + repository: adobe/aepsdk-commons + ref: main path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory @@ -127,8 +127,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: timkimadobe/aepsdk-commons - ref: ios-reusable-workflows + repository: adobe/aepsdk-commons + ref: main path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory @@ -153,8 +153,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: timkimadobe/aepsdk-commons - ref: ios-reusable-workflows + repository: adobe/aepsdk-commons + ref: main path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory @@ -179,8 +179,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: timkimadobe/aepsdk-commons - ref: ios-reusable-workflows + repository: adobe/aepsdk-commons + ref: main path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory @@ -205,8 +205,8 @@ jobs: - name: Checkout actions from aepsdk-commons uses: actions/checkout@v4.1.7 with: - repository: timkimadobe/aepsdk-commons - ref: ios-reusable-workflows + repository: adobe/aepsdk-commons + ref: main path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory From e66e41dffea29eb72126eeff4eeae7be8f2aceae Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:10:38 -0700 Subject: [PATCH 06/58] Rename directory and workflow to be platform specific Update cache action to latest 4.1.2 Update save cache actions to explicitly use the save action Update titles to sentence case --- .../action.yml | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) rename .github/actions/{setup-action => ios-setup-dependencies-action}/action.yml (70%) diff --git a/.github/actions/setup-action/action.yml b/.github/actions/ios-setup-dependencies-action/action.yml similarity index 70% rename from .github/actions/setup-action/action.yml rename to .github/actions/ios-setup-dependencies-action/action.yml index 900c43d7..87a66f60 100644 --- a/.github/actions/setup-action/action.yml +++ b/.github/actions/ios-setup-dependencies-action/action.yml @@ -1,33 +1,32 @@ -name: "Setup Dependencies" -description: "Checkout and install dependencies" +name: Setup Dependencies (iOS) +description: Checkout and install dependencies runs: using: "composite" steps: - - name: Restore Gemfile Cache - uses: actions/cache@v4.0.2 + - name: Restore Gemfile cache + uses: actions/cache@v4.1.2 with: path: vendor/bundle key: gems-${{ runner.os }}-${{ hashFiles('**/Gemfile.lock') }} - - name: Configure Bundler Path and Verify Cocoapods Version + - 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/cache@v4.0.2 + - name: Save Gemfile cache + uses: actions/cache/save@v4.1.2 with: path: vendor/bundle key: gems-${{ runner.os }}-${{ hashFiles('**/Gemfile.lock') }} - - name: Restore CocoaPods Cache - uses: actions/cache@v4.0.2 + - name: Restore CocoaPods cache + uses: actions/cache@v4.1.2 with: path: | Pods - SampleApps/TestApp/Pods ~/.cocoapods key: cocoapods-cache-v6-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('**/Podfile.lock') }} restore-keys: | @@ -39,7 +38,7 @@ runs: shell: bash - name: Save CocoaPods Cache - uses: actions/cache@v4.0.2 + uses: actions/cache/save@v4.1.2 with: path: | Pods From 213073a594c80aadf1fb0278723ff318b21679c2 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:10:56 -0700 Subject: [PATCH 07/58] Update title --- .github/actions/ios-setup-dependencies-action/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/ios-setup-dependencies-action/action.yml b/.github/actions/ios-setup-dependencies-action/action.yml index 87a66f60..492893d3 100644 --- a/.github/actions/ios-setup-dependencies-action/action.yml +++ b/.github/actions/ios-setup-dependencies-action/action.yml @@ -37,7 +37,7 @@ runs: run: make ci-pod-install shell: bash - - name: Save CocoaPods Cache + - name: Save CocoaPods cache uses: actions/cache/save@v4.1.2 with: path: | From 61169a4569e4f487d9f82272eb47252d7e49d30e Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:38:07 -0700 Subject: [PATCH 08/58] Update action versions to latest Add caching logic Add workflow_tag input variable --- .github/workflows/ios-build-and-test.yml | 60 +++++++++++++++++------- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index bc2ceeb5..d70b30dd 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -38,22 +38,41 @@ on: type: boolean default: true + workflow_tag: + description: 'The tag or ref of the reusable workflow being invoked (ex: gha-ios-1.0.0).' + type: string + required: true + jobs: validate-code: runs-on: macos-latest steps: - name: Checkout Repository - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 - - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.1.7 + - name: Restore cached actions from aepsdk-commons + id: cache-commons + uses: actions/cache@v4.1.1 + with: + path: .github/aepsdk-commons/.github/actions + key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - + + - name: Download actions from aepsdk-commons + if: steps.cache-commons.outputs.cache-hit != 'true' + uses: actions/checkout@v4.2.2 with: repository: adobe/aepsdk-commons - ref: main + ref: ${{ inputs.workflow_tag }} path: .github/aepsdk-commons sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory + - uses: actions/cache/save@v4.1.1 + if: steps.cache-commons.outputs.cache-hit != 'true' + with: + path: .github/aepsdk-commons/.github/actions + key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - + - name: Setup Dependencies uses: ./.github/aepsdk-commons/.github/actions/setup-action @@ -70,10 +89,17 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 - - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.1.7 + - name: Restore cached scripts from aepsdk-commons + id: cache-scripts + uses: actions/cache@v4.1.1 + with: + path: .github/aepsdk-commons/scripts + key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - + + - name: Download actions from aepsdk-commons + uses: actions/checkout@v4.2.2 with: repository: adobe/aepsdk-commons ref: main @@ -96,10 +122,10 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 with: repository: adobe/aepsdk-commons ref: main @@ -122,10 +148,10 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 with: repository: adobe/aepsdk-commons ref: main @@ -148,10 +174,10 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 with: repository: adobe/aepsdk-commons ref: main @@ -174,10 +200,10 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 with: repository: adobe/aepsdk-commons ref: main @@ -200,10 +226,10 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.1.7 + uses: actions/checkout@v4.2.2 with: repository: adobe/aepsdk-commons ref: main From 23a50791b95f96f15b9ff08bec3fb82859610921 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:06:09 -0700 Subject: [PATCH 09/58] Testing calling remote action directly --- .github/workflows/ios-build-and-test.yml | 49 ++++++++++++------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index d70b30dd..ba3c74bd 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -51,30 +51,31 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4.2.2 - - name: Restore cached actions from aepsdk-commons - id: cache-commons - uses: actions/cache@v4.1.1 - with: - path: .github/aepsdk-commons/.github/actions - key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - - - - name: Download actions from aepsdk-commons - if: steps.cache-commons.outputs.cache-hit != 'true' - uses: actions/checkout@v4.2.2 - with: - repository: adobe/aepsdk-commons - ref: ${{ inputs.workflow_tag }} - path: .github/aepsdk-commons - sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory - - - uses: actions/cache/save@v4.1.1 - if: steps.cache-commons.outputs.cache-hit != 'true' - with: - path: .github/aepsdk-commons/.github/actions - key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - - - - name: Setup Dependencies - uses: ./.github/aepsdk-commons/.github/actions/setup-action + # - name: Restore cached actions from aepsdk-commons + # id: cache-commons + # uses: actions/cache@v4.1.1 + # with: + # path: .github/aepsdk-commons/.github/actions + # key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - + + # - name: Download actions from aepsdk-commons + # if: steps.cache-commons.outputs.cache-hit != 'true' + # uses: actions/checkout@v4.2.2 + # with: + # repository: adobe/aepsdk-commons + # ref: ${{ inputs.workflow_tag }} + # path: .github/aepsdk-commons + # sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory + + # - uses: actions/cache/save@v4.1.1 + # if: steps.cache-commons.outputs.cache-hit != 'true' + # with: + # path: .github/aepsdk-commons/.github/actions + # key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - + + - name: Set up dependencies + # uses: ./.github/aepsdk-commons/.github/actions/setup-action + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Remove files from aepsdk-commons run: rm -rf ./github/aepsdk-commons From 4cea9e8448cfd122bd3ee7824288cd7245b225a2 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 13:15:35 -0800 Subject: [PATCH 10/58] TEST: using remote composite action --- .github/workflows/ios-build-and-test.yml | 78 ++++++++++++------------ 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index ba3c74bd..baab211a 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -51,31 +51,30 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4.2.2 - # - name: Restore cached actions from aepsdk-commons - # id: cache-commons - # uses: actions/cache@v4.1.1 - # with: - # path: .github/aepsdk-commons/.github/actions - # key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - + - name: Restore cached actions from aepsdk-commons + id: cache-commons + uses: actions/cache@v4.1.1 + with: + path: .github/aepsdk-commons/.github/actions + key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - - # - name: Download actions from aepsdk-commons - # if: steps.cache-commons.outputs.cache-hit != 'true' - # uses: actions/checkout@v4.2.2 - # with: - # repository: adobe/aepsdk-commons - # ref: ${{ inputs.workflow_tag }} - # path: .github/aepsdk-commons - # sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory + - name: Download actions from aepsdk-commons + if: steps.cache-commons.outputs.cache-hit != 'true' + uses: actions/checkout@v4.2.2 + with: + repository: adobe/aepsdk-commons + ref: ${{ inputs.workflow_tag }} + path: .github/aepsdk-commons + sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory - # - uses: actions/cache/save@v4.1.1 - # if: steps.cache-commons.outputs.cache-hit != 'true' - # with: - # path: .github/aepsdk-commons/.github/actions - # key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - + - uses: actions/cache/save@v4.1.1 + if: steps.cache-commons.outputs.cache-hit != 'true' + with: + path: .github/aepsdk-commons/.github/actions + key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - - name: Set up dependencies - # uses: ./.github/aepsdk-commons/.github/actions/setup-action - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github + uses: ./.github/aepsdk-commons/.github/actions/setup-action - name: Remove files from aepsdk-commons run: rm -rf ./github/aepsdk-commons @@ -92,26 +91,29 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4.2.2 - - name: Restore cached scripts from aepsdk-commons - id: cache-scripts - uses: actions/cache@v4.1.1 - with: - path: .github/aepsdk-commons/scripts - key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - + # - name: Restore cached scripts from aepsdk-commons + # id: cache-scripts + # uses: actions/cache@v4.1.1 + # with: + # path: .github/aepsdk-commons/scripts + # key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - - - name: Download actions from aepsdk-commons - uses: actions/checkout@v4.2.2 - with: - repository: adobe/aepsdk-commons - ref: main - path: .github/aepsdk-commons - sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory + # - name: Download actions from aepsdk-commons + # uses: actions/checkout@v4.2.2 + # 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: Setup Dependencies + # uses: ./.github/aepsdk-commons/.github/actions/setup-action - - name: Remove files from aepsdk-commons - run: rm -rf ./github/aepsdk-commons + # - name: Remove files from aepsdk-commons + # run: rm -rf ./github/aepsdk-commons + + - name: Setup Dependencies + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 - name: Run iOS Unit Tests run: make unit-test-ios From 3e673cd3c38a64f67bfd4faa03e87abfe22cdfd5 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 13:20:24 -0800 Subject: [PATCH 11/58] Remove outdated input workflow_tag --- .github/workflows/ios-build-and-test.yml | 55 +++++++++++------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index baab211a..7eb540a9 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -38,11 +38,6 @@ on: type: boolean default: true - workflow_tag: - description: 'The tag or ref of the reusable workflow being invoked (ex: gha-ios-1.0.0).' - type: string - required: true - jobs: validate-code: runs-on: macos-latest @@ -51,33 +46,35 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4.2.2 - - name: Restore cached actions from aepsdk-commons - id: cache-commons - uses: actions/cache@v4.1.1 - with: - path: .github/aepsdk-commons/.github/actions - key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - + # - name: Restore cached actions from aepsdk-commons + # id: cache-commons + # uses: actions/cache@v4.1.1 + # with: + # path: .github/aepsdk-commons/.github/actions + # key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - - - name: Download actions from aepsdk-commons - if: steps.cache-commons.outputs.cache-hit != 'true' - uses: actions/checkout@v4.2.2 - with: - repository: adobe/aepsdk-commons - ref: ${{ inputs.workflow_tag }} - path: .github/aepsdk-commons - sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory + # - name: Download actions from aepsdk-commons + # if: steps.cache-commons.outputs.cache-hit != 'true' + # uses: actions/checkout@v4.2.2 + # with: + # repository: adobe/aepsdk-commons + # ref: ${{ inputs.workflow_tag }} + # path: .github/aepsdk-commons + # sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory - - uses: actions/cache/save@v4.1.1 - if: steps.cache-commons.outputs.cache-hit != 'true' - with: - path: .github/aepsdk-commons/.github/actions - key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - + # - uses: actions/cache/save@v4.1.1 + # if: steps.cache-commons.outputs.cache-hit != 'true' + # with: + # path: .github/aepsdk-commons/.github/actions + # key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - - - name: Set up dependencies - uses: ./.github/aepsdk-commons/.github/actions/setup-action + # - name: Set up dependencies + # uses: ./.github/aepsdk-commons/.github/actions/setup-action - - name: Remove files from aepsdk-commons - run: rm -rf ./github/aepsdk-commons + # - name: Remove files from aepsdk-commons + # run: rm -rf ./github/aepsdk-commons + - name: Setup Dependencies + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 - name: Lint Source Code run: make lint @@ -113,7 +110,7 @@ jobs: # run: rm -rf ./github/aepsdk-commons - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 - name: Run iOS Unit Tests run: make unit-test-ios From ae10e89a92f435140faa8bcffc66cb4e1b16b2e2 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 13:34:55 -0800 Subject: [PATCH 12/58] Update all steps to use remote dependency setup composite action 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 --- .github/workflows/ios-build-and-test.yml | 144 +++-------------------- 1 file changed, 19 insertions(+), 125 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index 7eb540a9..026ae346 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -3,37 +3,34 @@ name: Build and Test (iOS) on: workflow_call: inputs: - device_name: + device-name: required: true type: string - os_version: - required: true - type: string - github_ref: + os-version: required: true type: string # Flags for jobs to run - run_test_ios_unit: + run-test-ios-unit: required: false type: boolean default: true - run_test_ios_functional: + run-test-ios-functional: required: false type: boolean default: true - run_test_ios_integration: + run-test-ios-integration: required: false type: boolean default: true - run_test_tvos_unit: + run-test-tvos-unit: required: false type: boolean default: true - run_test_tvos_functional: + run-test-tvos-functional: required: false type: boolean default: true - run_build_xcframework_and_app: + run-build-xcframework-and-app: required: false type: boolean default: true @@ -46,33 +43,6 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4.2.2 - # - name: Restore cached actions from aepsdk-commons - # id: cache-commons - # uses: actions/cache@v4.1.1 - # with: - # path: .github/aepsdk-commons/.github/actions - # key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - - - # - name: Download actions from aepsdk-commons - # if: steps.cache-commons.outputs.cache-hit != 'true' - # uses: actions/checkout@v4.2.2 - # with: - # repository: adobe/aepsdk-commons - # ref: ${{ inputs.workflow_tag }} - # path: .github/aepsdk-commons - # sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory - - # - uses: actions/cache/save@v4.1.1 - # if: steps.cache-commons.outputs.cache-hit != 'true' - # with: - # path: .github/aepsdk-commons/.github/actions - # key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - - - # - name: Set up dependencies - # uses: ./.github/aepsdk-commons/.github/actions/setup-action - - # - name: Remove files from aepsdk-commons - # run: rm -rf ./github/aepsdk-commons - name: Setup Dependencies uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 @@ -82,33 +52,12 @@ jobs: test-ios-unit: runs-on: macos-latest needs: validate-code - if: inputs.run_test_ios_unit + if: inputs.run-test-ios-unit steps: - name: Checkout Repository uses: actions/checkout@v4.2.2 - # - name: Restore cached scripts from aepsdk-commons - # id: cache-scripts - # uses: actions/cache@v4.1.1 - # with: - # path: .github/aepsdk-commons/scripts - # key: aepsdk-commons-${{ inputs.workflow_tag }} # Cache key format: - - - # - name: Download actions from aepsdk-commons - # uses: actions/checkout@v4.2.2 - # 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: Setup Dependencies uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 @@ -118,25 +67,14 @@ jobs: test-ios-functional: runs-on: macos-latest needs: validate-code - if: inputs.run_test_ios_functional + if: inputs.run-test-ios-functional steps: - name: Checkout Repository uses: actions/checkout@v4.2.2 - - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.2.2 - 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 + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 - name: Run iOS Functional Tests run: make functional-test-ios @@ -144,25 +82,14 @@ jobs: 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') + if: inputs.run-test-ios-integration && (${{ github.ref }} == 'refs/heads/main' || ${{ github.ref }} == 'refs/heads/staging') steps: - name: Checkout Repository uses: actions/checkout@v4.2.2 - - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.2.2 - 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 + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 - name: Run iOS Integration Tests run: make test-integration-upstream @@ -170,25 +97,14 @@ jobs: test-tvos-unit: runs-on: macos-latest needs: validate-code - if: inputs.run_test_tvos_unit + if: inputs.run-test-tvos-unit steps: - name: Checkout Repository uses: actions/checkout@v4.2.2 - - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.2.2 - 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 + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 - name: Run tvOS Unit Tests run: make unit-test-tvos @@ -196,25 +112,14 @@ jobs: test-tvos-functional: runs-on: macos-latest needs: validate-code - if: inputs.run_test_tvos_functional + if: inputs.run-test-tvos-functional steps: - name: Checkout Repository uses: actions/checkout@v4.2.2 - - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.2.2 - 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 + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 - name: Run tvOS Functional Tests run: make functional-test-tvos @@ -222,25 +127,14 @@ jobs: 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') + if: inputs.run-build-xcframework-and-app && (${{ github.ref }} == 'refs/heads/main' || ${{ github.ref }} == 'refs/heads/staging') steps: - name: Checkout Repository uses: actions/checkout@v4.2.2 - - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.2.2 - 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 + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 - name: Build XCFramework run: make archive From 402a665ab53cbccbb66cb42ef0fb02787e2b39df Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 13:40:37 -0800 Subject: [PATCH 13/58] Remove branch conditionals on job steps to allow caller repos to control this behavior --- .github/workflows/ios-build-and-test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index 026ae346..2f12ebc7 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -82,7 +82,6 @@ jobs: test-ios-integration: runs-on: macos-latest needs: validate-code - if: inputs.run-test-ios-integration && (${{ github.ref }} == 'refs/heads/main' || ${{ github.ref }} == 'refs/heads/staging') steps: - name: Checkout Repository @@ -127,7 +126,6 @@ jobs: build_xcframework_and_app: runs-on: macos-latest needs: validate-code - if: inputs.run-build-xcframework-and-app && (${{ github.ref }} == 'refs/heads/main' || ${{ github.ref }} == 'refs/heads/staging') steps: - name: Checkout Repository From 97181e67800198127c380b9baa4e6ca28a7e3651 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 14:28:47 -0800 Subject: [PATCH 14/58] TEST: add support for matrix device and os --- .github/workflows/ios-build-and-test.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index 2f12ebc7..dab831ca 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -3,10 +3,10 @@ name: Build and Test (iOS) on: workflow_call: inputs: - device-name: + device-names: required: true type: string - os-version: + os-versions: required: true type: string # Flags for jobs to run @@ -53,6 +53,10 @@ jobs: runs-on: macos-latest needs: validate-code if: inputs.run-test-ios-unit + strategy: + matrix: + device: ${{ fromJson(inputs.device-names) }} + os: ${{ fromJson(inputs.os-versions) }} steps: - name: Checkout Repository @@ -62,7 +66,7 @@ jobs: uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 - name: Run iOS Unit Tests - run: make unit-test-ios + run: make unit-test-ios IOS_DEVICE_NAME=${{ matrix.device }} IOS_VERSION=${{ matrix.os }} test-ios-functional: runs-on: macos-latest From 1ec45a72c1f6eefa23aef5cea5fa70fd57768b5c Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 14:36:11 -0800 Subject: [PATCH 15/58] Update iOS dependencies action to better handle explicit save step based on cache hit result --- .github/actions/ios-setup-dependencies-action/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/actions/ios-setup-dependencies-action/action.yml b/.github/actions/ios-setup-dependencies-action/action.yml index 492893d3..f68d3d12 100644 --- a/.github/actions/ios-setup-dependencies-action/action.yml +++ b/.github/actions/ios-setup-dependencies-action/action.yml @@ -5,6 +5,7 @@ runs: using: "composite" steps: - name: Restore Gemfile cache + id: cache-gems uses: actions/cache@v4.1.2 with: path: vendor/bundle @@ -17,12 +18,14 @@ runs: shell: bash - name: Save Gemfile cache + if: steps.cache-gems.outputs.cache-hit != 'true' uses: actions/cache/save@v4.1.2 with: path: vendor/bundle key: gems-${{ runner.os }}-${{ hashFiles('**/Gemfile.lock') }} - name: Restore CocoaPods cache + id: cache-pods uses: actions/cache@v4.1.2 with: path: | @@ -38,6 +41,7 @@ runs: shell: bash - name: Save CocoaPods cache + if: steps.cache-pods.outputs.cache-hit != 'true' uses: actions/cache/save@v4.1.2 with: path: | From 6c46355ab47958057e53f3187af8f6520bdc3728 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 14:41:56 -0800 Subject: [PATCH 16/58] Add quotes to handle spaces in device names --- .github/workflows/ios-build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index dab831ca..bae48f28 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -66,7 +66,7 @@ jobs: uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 - name: Run iOS Unit Tests - run: make unit-test-ios IOS_DEVICE_NAME=${{ matrix.device }} IOS_VERSION=${{ matrix.os }} + run: make unit-test-ios IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" test-ios-functional: runs-on: macos-latest From 54b86149169a81c4e8d2e2750f44647ecfb84533 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:03:11 -0800 Subject: [PATCH 17/58] Fix missing if checks for job steps to run --- .github/workflows/ios-build-and-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index bae48f28..6630addc 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -86,6 +86,7 @@ jobs: test-ios-integration: runs-on: macos-latest needs: validate-code + if: inputs.run-test-ios-integration steps: - name: Checkout Repository @@ -130,6 +131,7 @@ jobs: build_xcframework_and_app: runs-on: macos-latest needs: validate-code + if: inputs.run-build-xcframework-and-app steps: - name: Checkout Repository From 4d2eac249f49fcedad3422be39e92a78ee874997 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:36:18 -0800 Subject: [PATCH 18/58] Update inputs for test device matrix to have defaults and non-mandatory 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 --- .github/workflows/ios-build-and-test.yml | 93 +++++++++++++++++------- 1 file changed, 67 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index 6630addc..929d93e1 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -3,37 +3,53 @@ name: Build and Test (iOS) on: workflow_call: inputs: - device-names: - required: true + ios-device-names: + description: | + The iOS device names to use for testing. Must be formatted as a valid JSON array string. + Example: '["iPhone 15", "iPhone 15 Pro"]' + - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - os-versions: - required: true + default: '["iPhone 15"]' + ios-versions: + description: | + The iOS versions to use for testing. Must be formatted as a valid JSON array string. + Example: '["18.0", "18.1"]' + - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - # Flags for jobs to run + default: '["18.0"]' + tvos-device-names: + description: | + The tvOS device names to use for testing. Must be formatted as a valid JSON array string. + Example: '["Apple TV 4K (3rd generation)", "Apple TV"]' + - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. + type: string + default: '["Apple TV"]' + tvos-versions: + description: | + The tvOS versions to use for testing. Must be formatted as a valid JSON array string. + Example: '["18.0", "18.1"]' + - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. + type: string + default: '["18.0"]' + # Flags for which tests to run run-test-ios-unit: - required: false type: boolean - default: true + default: false run-test-ios-functional: - required: false type: boolean - default: true + default: false run-test-ios-integration: - required: false type: boolean - default: true + default: false run-test-tvos-unit: - required: false type: boolean - default: true + default: false run-test-tvos-functional: - required: false type: boolean - default: true + default: false run-build-xcframework-and-app: - required: false type: boolean - default: true + default: false jobs: validate-code: @@ -44,7 +60,7 @@ jobs: uses: actions/checkout@v4.2.2 - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Lint Source Code run: make lint @@ -55,30 +71,43 @@ jobs: if: inputs.run-test-ios-unit strategy: matrix: - device: ${{ fromJson(inputs.device-names) }} - os: ${{ fromJson(inputs.os-versions) }} + device: ${{ fromJson(inputs.ios-device-names) }} + os: ${{ fromJson(inputs.ios-versions) }} steps: - name: Checkout Repository uses: actions/checkout@v4.2.2 - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Run iOS Unit Tests run: make unit-test-ios IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" + + test-ios-unit2: + needs: validate-code + if: inputs.run-test-ios-unit + uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github + with: + device-names: ${{ inputs.ios-device-names }} + os-versions: ${{ inputs.ios-versions }} + command: make unit-test-ios test-ios-functional: runs-on: macos-latest needs: validate-code if: inputs.run-test-ios-functional + strategy: + matrix: + device: ${{ fromJson(inputs.ios-device-names) }} + os: ${{ fromJson(inputs.ios-versions) }} steps: - name: Checkout Repository uses: actions/checkout@v4.2.2 - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Run iOS Functional Tests run: make functional-test-ios @@ -87,13 +116,17 @@ jobs: runs-on: macos-latest needs: validate-code if: inputs.run-test-ios-integration + strategy: + matrix: + device: ${{ fromJson(inputs.ios-device-names) }} + os: ${{ fromJson(inputs.ios-versions) }} steps: - name: Checkout Repository uses: actions/checkout@v4.2.2 - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Run iOS Integration Tests run: make test-integration-upstream @@ -102,13 +135,17 @@ jobs: runs-on: macos-latest needs: validate-code if: inputs.run-test-tvos-unit + strategy: + matrix: + device: ${{ fromJson(inputs.tvos-device-names) }} + os: ${{ fromJson(inputs.tvos-versions) }} steps: - name: Checkout Repository uses: actions/checkout@v4.2.2 - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Run tvOS Unit Tests run: make unit-test-tvos @@ -117,13 +154,17 @@ jobs: runs-on: macos-latest needs: validate-code if: inputs.run-test-tvos-functional + strategy: + matrix: + device: ${{ fromJson(inputs.tvos-device-names) }} + os: ${{ fromJson(inputs.tvos-versions) }} steps: - name: Checkout Repository uses: actions/checkout@v4.2.2 - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Run tvOS Functional Tests run: make functional-test-tvos @@ -138,7 +179,7 @@ jobs: uses: actions/checkout@v4.2.2 - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-1.0.0 + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Build XCFramework run: make archive From b65cefcf1d0a4ec6a62d5a220877ef6c7c672039 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:36:54 -0800 Subject: [PATCH 19/58] Update custom command workflow to use composable action and optional validation step --- .../ios-custom-command-build-and-test.yml | 48 ++++++------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 50e53464..6fe7fc47 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -3,40 +3,29 @@ name: Custom Command Build and Test (iOS) on: workflow_call: inputs: - device_name: - required: true + device-names: type: string - os_version: required: true + os-versions: type: string - github_ref: required: true - type: string command: - required: true type: string + required: true + run-validate-code: + type: boolean + default: false jobs: validate-code: runs-on: macos-latest - + if: ${{ inputs.run-validate-code }} steps: - name: Checkout Repository - uses: actions/checkout@v4.1.7 - - - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.1.7 - with: - repository: adobe/aepsdk-commons - ref: main - path: .github/aepsdk-commons - sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory + uses: actions/checkout@v4.2.2 - name: Setup Dependencies - uses: ./.github/aepsdk-commons/.github/actions/setup-action - - - name: Remove files from aepsdk-commons - run: rm -rf ./github/aepsdk-commons + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Lint Source Code run: make lint @@ -44,24 +33,17 @@ jobs: custom-command: runs-on: macos-latest needs: validate-code + strategy: + matrix: + device: ${{ fromJson(inputs.device-names) }} + os: ${{ fromJson(inputs.os-versions) }} steps: - name: Checkout Repository - uses: actions/checkout@v4.1.7 - - - name: Checkout actions from aepsdk-commons - uses: actions/checkout@v4.1.7 - with: - repository: adobe/aepsdk-commons - ref: main - path: .github/aepsdk-commons - sparse-checkout: '.github/actions' # Only checkout the GitHub actions directory + uses: actions/checkout@v4.2.2 - name: Setup Dependencies - uses: ./.github/aepsdk-commons/.github/actions/setup-action - - - name: Remove files from aepsdk-commons - run: rm -rf ./github/aepsdk-commons + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Run ${{ inputs.command }} run: ${{ inputs.command }} From 8c157da7fab518fc1446ec7ef6a0783c00109cd3 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:48:14 -0800 Subject: [PATCH 20/58] Add logic to run matrix without validation if validation is not used --- .../ios-custom-command-build-and-test.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 6fe7fc47..5137abe7 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -47,3 +47,21 @@ jobs: - name: Run ${{ inputs.command }} run: ${{ inputs.command }} + + custom-command-no-validate: + runs-on: macos-latest + if: ${{ !inputs.run-validate-code }} + strategy: + matrix: + device: ${{ fromJson(inputs.device-names) }} + os: ${{ fromJson(inputs.os-versions) }} + + steps: + - name: Checkout Repository + uses: actions/checkout@v4.2.2 + + - name: Setup Dependencies + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github + + - name: Run ${{ inputs.command }} + run: ${{ inputs.command }} From 36bcd3b4bac8dc74236ff66f7508f038193e3fe1 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:51:49 -0800 Subject: [PATCH 21/58] try different bool check --- .github/workflows/ios-custom-command-build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 5137abe7..36773c25 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -50,7 +50,7 @@ jobs: custom-command-no-validate: runs-on: macos-latest - if: ${{ !inputs.run-validate-code }} + if: ${{ inputs.run-validate-code == false }} strategy: matrix: device: ${{ fromJson(inputs.device-names) }} From 2519ff0c7f19977750952680ca0da6581c88440f Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:20:55 -0800 Subject: [PATCH 22/58] Test using custom command --- .github/workflows/ios-build-and-test.yml | 44 ++++++------- .../ios-custom-command-build-and-test.yml | 66 ++++++++++--------- 2 files changed, 58 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index 929d93e1..4bcbece9 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -65,24 +65,24 @@ jobs: - name: Lint Source Code run: make lint - test-ios-unit: - runs-on: macos-latest - needs: validate-code - if: inputs.run-test-ios-unit - strategy: - matrix: - device: ${{ fromJson(inputs.ios-device-names) }} - os: ${{ fromJson(inputs.ios-versions) }} - - steps: - - name: Checkout Repository - uses: actions/checkout@v4.2.2 - - - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - - - name: Run iOS Unit Tests - run: make unit-test-ios IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" + # test-ios-unit: + # runs-on: macos-latest + # needs: validate-code + # if: inputs.run-test-ios-unit + # strategy: + # matrix: + # device: ${{ fromJson(inputs.ios-device-names) }} + # os: ${{ fromJson(inputs.ios-versions) }} + + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v4.2.2 + + # - name: Setup Dependencies + # uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github + + # - name: Run iOS Unit Tests + # run: make unit-test-ios IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" test-ios-unit2: needs: validate-code @@ -110,7 +110,7 @@ jobs: uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Run iOS Functional Tests - run: make functional-test-ios + run: make functional-test-ios IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" test-ios-integration: runs-on: macos-latest @@ -129,7 +129,7 @@ jobs: uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Run iOS Integration Tests - run: make test-integration-upstream + run: make test-integration-upstream IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" test-tvos-unit: runs-on: macos-latest @@ -148,7 +148,7 @@ jobs: uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Run tvOS Unit Tests - run: make unit-test-tvos + run: make unit-test-tvos TVOS_DEVICE_NAME="${{ matrix.device }}" TVOS_VERSION="${{ matrix.os }}" test-tvos-functional: runs-on: macos-latest @@ -167,7 +167,7 @@ jobs: uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Run tvOS Functional Tests - run: make functional-test-tvos + run: make functional-test-tvos TVOS_DEVICE_NAME="${{ matrix.device }}" TVOS_VERSION="${{ matrix.os }}" build_xcframework_and_app: runs-on: macos-latest diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 36773c25..0b9c00eb 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -3,40 +3,46 @@ name: Custom Command Build and Test (iOS) on: workflow_call: inputs: - device-names: + ios-device-names: + description: | + The iOS device names to use for testing. Must be formatted as a valid JSON array string. + Example: '["iPhone 15", "iPhone 15 Pro"]' + - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - required: true - os-versions: + default: '' + ios-versions: + description: | + The iOS versions to use for testing. Must be formatted as a valid JSON array string. + Example: '["18.0", "18.1"]' + - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - required: true + default: '' + tvos-device-names: + description: | + The tvOS device names to use for testing. Must be formatted as a valid JSON array string. + Example: '["Apple TV 4K (3rd generation)", "Apple TV"]' + - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. + type: string + default: '' + tvos-versions: + description: | + The tvOS versions to use for testing. Must be formatted as a valid JSON array string. + Example: '["18.0", "18.1"]' + - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. + type: string + default: '' command: type: string required: true - run-validate-code: - type: boolean - default: false jobs: - validate-code: - runs-on: macos-latest - if: ${{ inputs.run-validate-code }} - steps: - - name: Checkout Repository - uses: actions/checkout@v4.2.2 - - - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - - - name: Lint Source Code - run: make lint - - custom-command: + ios-custom-command: runs-on: macos-latest - needs: validate-code + if: ${{ inputs.ios-device-names != '' }} strategy: matrix: - device: ${{ fromJson(inputs.device-names) }} - os: ${{ fromJson(inputs.os-versions) }} + device: ${{ fromJson(inputs.ios-device-names) }} + os: ${{ fromJson(inputs.ios-versions) }} steps: - name: Checkout Repository @@ -46,15 +52,15 @@ jobs: uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Run ${{ inputs.command }} - run: ${{ inputs.command }} + run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" - custom-command-no-validate: + tvos-custom-command: runs-on: macos-latest - if: ${{ inputs.run-validate-code == false }} + if: ${{ inputs.tvos-device-names != '' }} strategy: matrix: - device: ${{ fromJson(inputs.device-names) }} - os: ${{ fromJson(inputs.os-versions) }} + device: ${{ fromJson(inputs.tvos-device-names) }} + os: ${{ fromJson(inputs.tvos-versions) }} steps: - name: Checkout Repository @@ -64,4 +70,4 @@ jobs: uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - name: Run ${{ inputs.command }} - run: ${{ inputs.command }} + run: ${{ inputs.command }} TVOS_DEVICE_NAME="${{ matrix.device }}" TVOS_VERSION="${{ matrix.os }}" From f9b3b053f0ab1a57e59af5a92db1c77381e5dd7e Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:22:29 -0800 Subject: [PATCH 23/58] Fix input names --- .github/workflows/ios-build-and-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index 4bcbece9..d48b9439 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -89,8 +89,8 @@ jobs: if: inputs.run-test-ios-unit uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github with: - device-names: ${{ inputs.ios-device-names }} - os-versions: ${{ inputs.ios-versions }} + ios-device-names: ${{ inputs.ios-device-names }} + ios-versions: ${{ inputs.ios-versions }} command: make unit-test-ios test-ios-functional: From fa2b56deb638d5c50e7e2534e7de300c025d2de6 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:32:36 -0800 Subject: [PATCH 24/58] Test splitting actions into smaller workflows --- .github/workflows/ios-build-and-test.yml | 113 +++++------------------ .github/workflows/ios-validate-code.yml | 18 ++++ 2 files changed, 40 insertions(+), 91 deletions(-) create mode 100644 .github/workflows/ios-validate-code.yml diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index d48b9439..94a8e6bb 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -53,38 +53,9 @@ on: jobs: validate-code: - runs-on: macos-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4.2.2 - - - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - - - name: Lint Source Code - run: make lint - - # test-ios-unit: - # runs-on: macos-latest - # needs: validate-code - # if: inputs.run-test-ios-unit - # strategy: - # matrix: - # device: ${{ fromJson(inputs.ios-device-names) }} - # os: ${{ fromJson(inputs.ios-versions) }} - - # steps: - # - name: Checkout Repository - # uses: actions/checkout@v4.2.2 - - # - name: Setup Dependencies - # uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - - # - name: Run iOS Unit Tests - # run: make unit-test-ios IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" + uses: timkimadobe/aepsdk-commons/.github/workflows/ios-validate-code.yml@ios-circleci-to-github - test-ios-unit2: + test-ios-unit: needs: validate-code if: inputs.run-test-ios-unit uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github @@ -94,80 +65,40 @@ jobs: command: make unit-test-ios test-ios-functional: - runs-on: macos-latest needs: validate-code if: inputs.run-test-ios-functional - strategy: - matrix: - device: ${{ fromJson(inputs.ios-device-names) }} - os: ${{ fromJson(inputs.ios-versions) }} - - steps: - - name: Checkout Repository - uses: actions/checkout@v4.2.2 - - - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - - - name: Run iOS Functional Tests - run: make functional-test-ios IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" + uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github + with: + ios-device-names: ${{ inputs.ios-device-names }} + ios-versions: ${{ inputs.ios-versions }} + command: make functional-test-ios test-ios-integration: - runs-on: macos-latest needs: validate-code if: inputs.run-test-ios-integration - strategy: - matrix: - device: ${{ fromJson(inputs.ios-device-names) }} - os: ${{ fromJson(inputs.ios-versions) }} - - steps: - - name: Checkout Repository - uses: actions/checkout@v4.2.2 - - - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - - - name: Run iOS Integration Tests - run: make test-integration-upstream IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" + uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github + with: + ios-device-names: ${{ inputs.ios-device-names }} + ios-versions: ${{ inputs.ios-versions }} + command: make test-integration-upstream test-tvos-unit: - runs-on: macos-latest needs: validate-code if: inputs.run-test-tvos-unit - strategy: - matrix: - device: ${{ fromJson(inputs.tvos-device-names) }} - os: ${{ fromJson(inputs.tvos-versions) }} - - steps: - - name: Checkout Repository - uses: actions/checkout@v4.2.2 - - - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - - - name: Run tvOS Unit Tests - run: make unit-test-tvos TVOS_DEVICE_NAME="${{ matrix.device }}" TVOS_VERSION="${{ matrix.os }}" + uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github + with: + tvos-device-names: ${{ inputs.tvos-device-names }} + tvos-versions: ${{ inputs.tvos-versions }} + command: make unit-test-tvos test-tvos-functional: - runs-on: macos-latest needs: validate-code if: inputs.run-test-tvos-functional - strategy: - matrix: - device: ${{ fromJson(inputs.tvos-device-names) }} - os: ${{ fromJson(inputs.tvos-versions) }} - - steps: - - name: Checkout Repository - uses: actions/checkout@v4.2.2 - - - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - - - name: Run tvOS Functional Tests - run: make functional-test-tvos TVOS_DEVICE_NAME="${{ matrix.device }}" TVOS_VERSION="${{ matrix.os }}" + uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github + with: + tvos-device-names: ${{ inputs.tvos-device-names }} + tvos-versions: ${{ inputs.tvos-versions }} + command: make functional-test-tvos build_xcframework_and_app: runs-on: macos-latest diff --git a/.github/workflows/ios-validate-code.yml b/.github/workflows/ios-validate-code.yml new file mode 100644 index 00000000..22b3eba3 --- /dev/null +++ b/.github/workflows/ios-validate-code.yml @@ -0,0 +1,18 @@ +name: Validate Code (iOS) + +on: + workflow_call: + +jobs: + validate-code: + runs-on: macos-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4.2.2 + + - name: Setup Dependencies + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github + + - name: Lint Source Code + run: make lint From 53af8ee2fe1986aaa0bc10c936f1b153c55e3044 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:40:05 -0800 Subject: [PATCH 25/58] Add names to custom command workflow jobs --- .github/workflows/ios-custom-command-build-and-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 0b9c00eb..297a5f6d 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -37,6 +37,7 @@ on: jobs: ios-custom-command: + name: ${{ inputs.command }} (iOS) runs-on: macos-latest if: ${{ inputs.ios-device-names != '' }} strategy: @@ -55,6 +56,7 @@ jobs: run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" tvos-custom-command: + name: ${{ inputs.command }} (tvOS) runs-on: macos-latest if: ${{ inputs.tvos-device-names != '' }} strategy: From 514a58b32ec27a570fa44004cf9a1731c1299a06 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:41:47 -0800 Subject: [PATCH 26/58] Add names to ios build and test workflow --- .github/workflows/ios-build-and-test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index 94a8e6bb..f786c893 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -56,6 +56,7 @@ jobs: uses: timkimadobe/aepsdk-commons/.github/workflows/ios-validate-code.yml@ios-circleci-to-github test-ios-unit: + name: Unit Test (iOS) needs: validate-code if: inputs.run-test-ios-unit uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github @@ -65,6 +66,7 @@ jobs: command: make unit-test-ios test-ios-functional: + name: Functional Test (iOS) needs: validate-code if: inputs.run-test-ios-functional uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github @@ -74,6 +76,7 @@ jobs: command: make functional-test-ios test-ios-integration: + name: Integration Test (iOS) needs: validate-code if: inputs.run-test-ios-integration uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github @@ -83,6 +86,7 @@ jobs: command: make test-integration-upstream test-tvos-unit: + name: Unit Test (tvOS) needs: validate-code if: inputs.run-test-tvos-unit uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github @@ -92,6 +96,7 @@ jobs: command: make unit-test-tvos test-tvos-functional: + name: Functional Test (tvOS) needs: validate-code if: inputs.run-test-tvos-functional uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github @@ -101,6 +106,7 @@ jobs: command: make functional-test-tvos build_xcframework_and_app: + name: Build XCFramework and Test App runs-on: macos-latest needs: validate-code if: inputs.run-build-xcframework-and-app From 407327579d2d91e4df4dc8bbbdd3091333ead5ba Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:43:43 -0800 Subject: [PATCH 27/58] Add matrix device and os info to name --- .github/workflows/ios-custom-command-build-and-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 297a5f6d..b748a498 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -37,7 +37,7 @@ on: jobs: ios-custom-command: - name: ${{ inputs.command }} (iOS) + name: ${{ inputs.command }} (iOS - ${{ matrix.device }} ${{ matrix.os }}) runs-on: macos-latest if: ${{ inputs.ios-device-names != '' }} strategy: @@ -56,7 +56,7 @@ jobs: run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" tvos-custom-command: - name: ${{ inputs.command }} (tvOS) + name: ${{ inputs.command }} (tvOS - ${{ matrix.device }} ${{ matrix.os }}) runs-on: macos-latest if: ${{ inputs.tvos-device-names != '' }} strategy: From fd74a5b32fbfef492f56f7113bcbdea952b365a9 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:58:33 -0800 Subject: [PATCH 28/58] Update validate code job name --- .github/workflows/ios-build-and-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index f786c893..ef756ca8 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -53,6 +53,7 @@ on: jobs: validate-code: + name: Validate Code uses: timkimadobe/aepsdk-commons/.github/workflows/ios-validate-code.yml@ios-circleci-to-github test-ios-unit: From 187a509d70d2facb8f248e332add08908f77d7ff Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:05:10 -0800 Subject: [PATCH 29/58] Remove fluff from job names --- .github/workflows/ios-build-and-test.yml | 2 +- .github/workflows/ios-custom-command-build-and-test.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index ef756ca8..417f8e7c 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -1,4 +1,4 @@ -name: Build and Test (iOS) +name: Build and Test on: workflow_call: diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index b748a498..0ad9988c 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -37,7 +37,7 @@ on: jobs: ios-custom-command: - name: ${{ inputs.command }} (iOS - ${{ matrix.device }} ${{ matrix.os }}) + name: ${{ matrix.device }} ${{ matrix.os }} runs-on: macos-latest if: ${{ inputs.ios-device-names != '' }} strategy: @@ -56,7 +56,7 @@ jobs: run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" tvos-custom-command: - name: ${{ inputs.command }} (tvOS - ${{ matrix.device }} ${{ matrix.os }}) + name: ${{ matrix.device }} ${{ matrix.os }} runs-on: macos-latest if: ${{ inputs.tvos-device-names != '' }} strategy: From a9d9ea1ad22737493a189977f07b6f54c2545145 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:24:45 -0800 Subject: [PATCH 30/58] Try combining into single step --- .../ios-custom-command-build-and-test.yml | 35 ++++++------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 0ad9988c..6850674d 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -36,14 +36,16 @@ on: required: true jobs: - ios-custom-command: - name: ${{ matrix.device }} ${{ matrix.os }} + run-custom-command: + name: ${{ matrix.ios-device }} ${{ matrix.ios }} ${{ matrix.tvos-device }} ${{ matrix.tvos }} runs-on: macos-latest if: ${{ inputs.ios-device-names != '' }} strategy: matrix: - device: ${{ fromJson(inputs.ios-device-names) }} - os: ${{ fromJson(inputs.ios-versions) }} + ios-device: ${{ fromJson(inputs.ios-device-names) }} + ios: ${{ fromJson(inputs.ios-versions) }} + tvos-device: ${{ fromJson(inputs.tvos-device-names) }} + tvos: ${{ fromJson(inputs.tvos-versions) }} steps: - name: Checkout Repository @@ -52,24 +54,9 @@ jobs: - name: Setup Dependencies uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - - name: Run ${{ inputs.command }} - run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.device }}" IOS_VERSION="${{ matrix.os }}" - - tvos-custom-command: - name: ${{ matrix.device }} ${{ matrix.os }} - runs-on: macos-latest - if: ${{ inputs.tvos-device-names != '' }} - strategy: - matrix: - device: ${{ fromJson(inputs.tvos-device-names) }} - os: ${{ fromJson(inputs.tvos-versions) }} - - steps: - - name: Checkout Repository - uses: actions/checkout@v4.2.2 - - - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github + - if: ${{ matrix.ios-device }} + name: Run ${{ inputs.command }} + run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" - - name: Run ${{ inputs.command }} - run: ${{ inputs.command }} TVOS_DEVICE_NAME="${{ matrix.device }}" TVOS_VERSION="${{ matrix.os }}" + - if: ${{ matrix.tvos-device }} + run: ${{ inputs.command }} TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" From e6a7c4f40cd997cd1749f44db5aa5bdac9f3417b Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:25:53 -0800 Subject: [PATCH 31/58] Test combining into single step --- .github/workflows/ios-custom-command-build-and-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 6850674d..54e152e5 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -56,7 +56,7 @@ jobs: - if: ${{ matrix.ios-device }} name: Run ${{ inputs.command }} - run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" + run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" - - if: ${{ matrix.tvos-device }} - run: ${{ inputs.command }} TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" + # - if: ${{ matrix.tvos-device }} + # run: ${{ inputs.command }} TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" From e71915291d7adab5f5a39373bdc21cf939eaeb30 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:27:56 -0800 Subject: [PATCH 32/58] Update default matrix values --- .github/workflows/ios-custom-command-build-and-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 54e152e5..80e040e0 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -9,28 +9,28 @@ on: Example: '["iPhone 15", "iPhone 15 Pro"]' - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - default: '' + default: '[]' ios-versions: description: | The iOS versions to use for testing. Must be formatted as a valid JSON array string. Example: '["18.0", "18.1"]' - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - default: '' + default: '[]' tvos-device-names: description: | The tvOS device names to use for testing. Must be formatted as a valid JSON array string. Example: '["Apple TV 4K (3rd generation)", "Apple TV"]' - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - default: '' + default: '[]' tvos-versions: description: | The tvOS versions to use for testing. Must be formatted as a valid JSON array string. Example: '["18.0", "18.1"]' - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - default: '' + default: '[]' command: type: string required: true From 2c02a819512159c8b53f858019eafcc3494ea337 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:33:59 -0800 Subject: [PATCH 33/58] try using include instead --- .../ios-custom-command-build-and-test.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 80e040e0..7c3c781d 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -41,11 +41,17 @@ jobs: runs-on: macos-latest if: ${{ inputs.ios-device-names != '' }} strategy: + max-parallel: 2 matrix: - ios-device: ${{ fromJson(inputs.ios-device-names) }} - ios: ${{ fromJson(inputs.ios-versions) }} - tvos-device: ${{ fromJson(inputs.tvos-device-names) }} - tvos: ${{ fromJson(inputs.tvos-versions) }} + # ios-device: ${{ fromJson(inputs.ios-device-names) }} + # ios: ${{ fromJson(inputs.ios-versions) }} + # tvos-device: ${{ fromJson(inputs.tvos-device-names) }} + # tvos: ${{ fromJson(inputs.tvos-versions) }} + include: + - ios-device: ${{ fromJson(inputs.ios-device-names) }} + ios: ${{ fromJson(inputs.ios-versions) }} + tvos-device: ${{ fromJson(inputs.tvos-device-names) }} + tvos: ${{ fromJson(inputs.tvos-versions) }} steps: - name: Checkout Repository From ef3472fdf724c6e2b16298f526ece5f0cd7df5fa Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:36:52 -0800 Subject: [PATCH 34/58] Update defaults --- .../ios-custom-command-build-and-test.yml | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 7c3c781d..3f33a0f9 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -9,28 +9,28 @@ on: Example: '["iPhone 15", "iPhone 15 Pro"]' - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - default: '[]' + default: '["iPhone 15"]' ios-versions: description: | The iOS versions to use for testing. Must be formatted as a valid JSON array string. Example: '["18.0", "18.1"]' - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - default: '[]' + default: '["18.0"]' tvos-device-names: description: | The tvOS device names to use for testing. Must be formatted as a valid JSON array string. Example: '["Apple TV 4K (3rd generation)", "Apple TV"]' - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - default: '[]' + default: '["Apple TV"]' tvos-versions: description: | The tvOS versions to use for testing. Must be formatted as a valid JSON array string. Example: '["18.0", "18.1"]' - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - default: '[]' + default: '["18.0"]' command: type: string required: true @@ -43,15 +43,10 @@ jobs: strategy: max-parallel: 2 matrix: - # ios-device: ${{ fromJson(inputs.ios-device-names) }} - # ios: ${{ fromJson(inputs.ios-versions) }} - # tvos-device: ${{ fromJson(inputs.tvos-device-names) }} - # tvos: ${{ fromJson(inputs.tvos-versions) }} - include: - - ios-device: ${{ fromJson(inputs.ios-device-names) }} - ios: ${{ fromJson(inputs.ios-versions) }} - tvos-device: ${{ fromJson(inputs.tvos-device-names) }} - tvos: ${{ fromJson(inputs.tvos-versions) }} + ios-device: ${{ fromJson(inputs.ios-device-names) }} + ios: ${{ fromJson(inputs.ios-versions) }} + tvos-device: ${{ fromJson(inputs.tvos-device-names) }} + tvos: ${{ fromJson(inputs.tvos-versions) }} steps: - name: Checkout Repository From 7901c0990a8a6f0f5c54c5274d1f2e194a76b61c Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:55:43 -0800 Subject: [PATCH 35/58] Update to handle default matrix values --- .../ios-custom-command-build-and-test.yml | 90 +++++++++++++++++-- 1 file changed, 81 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 3f33a0f9..df734d09 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -9,44 +9,116 @@ on: Example: '["iPhone 15", "iPhone 15 Pro"]' - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - default: '["iPhone 15"]' + default: '' ios-versions: description: | The iOS versions to use for testing. Must be formatted as a valid JSON array string. Example: '["18.0", "18.1"]' - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - default: '["18.0"]' + default: '' tvos-device-names: description: | The tvOS device names to use for testing. Must be formatted as a valid JSON array string. Example: '["Apple TV 4K (3rd generation)", "Apple TV"]' - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - default: '["Apple TV"]' + default: '' tvos-versions: description: | The tvOS versions to use for testing. Must be formatted as a valid JSON array string. Example: '["18.0", "18.1"]' - Notice the use of single quotes to wrap the JSON array string, and double quotes for each array element. type: string - default: '["18.0"]' + default: '' command: type: string required: true jobs: + define-matrix: + runs-on: ubuntu-latest + outputs: + ios-device-names: ${{ steps.define-matrix.outputs.ios-device-names }} + ios-versions: ${{ steps.define-matrix.outputs.ios-versions }} + tvos-device-names: ${{ steps.define-matrix.outputs.tvos-device-names }} + tvos-versions: ${{ steps.define-matrix.outputs.tvos-versions }} + is-default-ios-device: ${{ steps.define-matrix.outputs.is-default-ios-device }} + is-default-ios: ${{ steps.define-matrix.outputs.is-default-ios }} + is-default-tvos-device: ${{ steps.define-matrix.outputs.is-default-tvos-device }} + is-default-tvos: ${{ steps.define-matrix.outputs.is-default-tvos }} + steps: + - name: Define Matrix + id: define-matrix + shell: bash + run: | + # Set default values + default_ios_device_names='["iPhone 15"]' + default_ios_versions='["18.0"]' + default_tvos_device_names='["Apple TV"]' + default_tvos_versions='["18.0"]' + + # Get inputs + ios_device_names='${{ inputs.ios-device-names }}' + ios_versions='${{ inputs.ios-versions }}' + tvos_device_names='${{ inputs.tvos-device-names }}' + tvos_versions='${{ inputs.tvos-versions }}' + + # Check and set default values + if [ -z "$ios_device_names" ]; then + ios_device_names="$default_ios_device_names" + is_default_ios_device='true' + else + is_default_ios_device='false' + fi + + if [ -z "$ios_versions" ]; then + ios_versions="$default_ios_versions" + is_default_ios='true' + else + is_default_ios='false' + fi + + if [ -z "$tvos_device_names" ]; then + tvos_device_names="$default_tvos_device_names" + is_default_tvos_device='true' + else + is_default_tvos_device='false' + fi + + if [ -z "$tvos_versions" ]; then + tvos_versions="$default_tvos_versions" + is_default_tvos='true' + else + is_default_tvos='false' + fi + + # Set outputs + echo "ios-device-names=$ios_device_names" >> "$GITHUB_OUTPUT" + echo "ios-versions=$ios_versions" >> "$GITHUB_OUTPUT" + echo "tvos-device-names=$tvos_device_names" >> "$GITHUB_OUTPUT" + echo "tvos-versions=$tvos_versions" >> "$GITHUB_OUTPUT" + + echo "is-default-ios-device=$is_default_ios_device" >> "$GITHUB_OUTPUT" + echo "is-default-ios=$is_default_ios" >> "$GITHUB_OUTPUT" + echo "is-default-tvos-device=$is_default_tvos_device" >> "$GITHUB_OUTPUT" + echo "is-default-tvos=$is_default_tvos" >> "$GITHUB_OUTPUT" run-custom-command: - name: ${{ matrix.ios-device }} ${{ matrix.ios }} ${{ matrix.tvos-device }} ${{ matrix.tvos }} + name: > + ${{ needs.define-matrix.outputs.is-default-ios-device != 'true' && matrix.ios-device || '' }} + ${{ needs.define-matrix.outputs.is-default-ios != 'true' && matrix.ios || '' }} + ${{ needs.define-matrix.outputs.is-default-tvos-device != 'true' && matrix.tvos-device || '' }} + ${{ needs.define-matrix.outputs.is-default-tvos != 'true' && matrix.tvos || '' }} runs-on: macos-latest + needs: define-matrix if: ${{ inputs.ios-device-names != '' }} strategy: max-parallel: 2 matrix: - ios-device: ${{ fromJson(inputs.ios-device-names) }} - ios: ${{ fromJson(inputs.ios-versions) }} - tvos-device: ${{ fromJson(inputs.tvos-device-names) }} - tvos: ${{ fromJson(inputs.tvos-versions) }} + ios-device: ${{ fromJson(needs.define-matrix.outputs.ios-device-names) }} + ios: ${{ fromJson(needs.define-matrix.outputs.ios-versions) }} + tvos-device: ${{ fromJson(needs.define-matrix.outputs.tvos-device-names) }} + tvos: ${{ fromJson(needs.define-matrix.outputs.tvos-versions) }} steps: - name: Checkout Repository From 7ea19df0cb92d55afb7b4b4265ebd84a409a8468 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:04:03 -0800 Subject: [PATCH 36/58] Clean up code and update names --- .github/workflows/ios-build-and-test.yml | 2 +- .github/workflows/ios-custom-command-build-and-test.yml | 6 +----- .github/workflows/ios-validate-code.yml | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index 417f8e7c..ef756ca8 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -1,4 +1,4 @@ -name: Build and Test +name: Build and Test (iOS) on: workflow_call: diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index df734d09..56c1d54b 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -127,9 +127,5 @@ jobs: - name: Setup Dependencies uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - - if: ${{ matrix.ios-device }} - name: Run ${{ inputs.command }} + - name: Run ${{ inputs.command }} run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" - - # - if: ${{ matrix.tvos-device }} - # run: ${{ inputs.command }} TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" diff --git a/.github/workflows/ios-validate-code.yml b/.github/workflows/ios-validate-code.yml index 22b3eba3..22cf6644 100644 --- a/.github/workflows/ios-validate-code.yml +++ b/.github/workflows/ios-validate-code.yml @@ -5,6 +5,7 @@ on: jobs: validate-code: + name: Validate Code runs-on: macos-latest steps: From 907898eb7f7e2c1a1affef8544c0c814a9e1068a Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:13:19 -0800 Subject: [PATCH 37/58] Remove outdated if check --- .github/workflows/ios-custom-command-build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 56c1d54b..ba965c7b 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -37,6 +37,7 @@ on: jobs: define-matrix: + name: Define Matrix runs-on: ubuntu-latest outputs: ios-device-names: ${{ steps.define-matrix.outputs.ios-device-names }} @@ -111,7 +112,6 @@ jobs: ${{ needs.define-matrix.outputs.is-default-tvos != 'true' && matrix.tvos || '' }} runs-on: macos-latest needs: define-matrix - if: ${{ inputs.ios-device-names != '' }} strategy: max-parallel: 2 matrix: From 3d9d190a4d8059ed57722fa0abb0dd3c4de04ca3 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Tue, 5 Nov 2024 19:05:24 -0800 Subject: [PATCH 38/58] Add tvOS integration test step --- .github/workflows/ios-build-and-test.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index ef756ca8..5bc29928 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -47,6 +47,9 @@ on: run-test-tvos-functional: type: boolean default: false + run-test-tvos-integration: + type: boolean + default: false run-build-xcframework-and-app: type: boolean default: false @@ -105,6 +108,16 @@ jobs: tvos-device-names: ${{ inputs.tvos-device-names }} tvos-versions: ${{ inputs.tvos-versions }} command: make functional-test-tvos + + test-tvos-integration: + name: Integration Test (tvOS) + needs: validate-code + if: inputs.run-test-tvos-integration + uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github + with: + tvos-device-names: ${{ inputs.tvos-device-names }} + tvos-versions: ${{ inputs.tvos-versions }} + command: make integration-test-tvos build_xcframework_and_app: name: Build XCFramework and Test App From 60801a24a89144b0c55751a177fe4805599406e3 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:05:28 -0800 Subject: [PATCH 39/58] Test using codecov action --- .github/workflows/ios-custom-command-build-and-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index ba965c7b..62fb4e5b 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -129,3 +129,6 @@ jobs: - name: Run ${{ inputs.command }} run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" + + - name: Upload Code Coverage + uses: codecov/codecov-action@v4.6.0 From 9d386bf5206b79634b1689f0fc1d66e31bbf2d56 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:44:24 -0800 Subject: [PATCH 40/58] Explicitly pass token --- .github/workflows/ios-custom-command-build-and-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 62fb4e5b..7004efcd 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -132,3 +132,5 @@ jobs: - name: Upload Code Coverage uses: codecov/codecov-action@v4.6.0 + with: + token: ${{ secrets.CODECOV_TOKEN }} From 9844fd1739f4d3d84d28a46b3e184d66c9d074bb Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:51:08 -0800 Subject: [PATCH 41/58] Try passing secrets using inherit --- .github/workflows/ios-build-and-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index 5bc29928..28ebdcbd 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -68,6 +68,7 @@ jobs: ios-device-names: ${{ inputs.ios-device-names }} ios-versions: ${{ inputs.ios-versions }} command: make unit-test-ios + secrets: inherit test-ios-functional: name: Functional Test (iOS) From 882654508a2cedc03db497c33e31a6cf24783c08 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:02:07 -0800 Subject: [PATCH 42/58] Try specifying yaml path --- .github/workflows/ios-custom-command-build-and-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 7004efcd..8578e0fa 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -134,3 +134,4 @@ jobs: uses: codecov/codecov-action@v4.6.0 with: token: ${{ secrets.CODECOV_TOKEN }} + codecov_yml_path: ${{ github.workspace }}/codecov.yml From c4e9710340f3b405efe2e138bb4a2c1b5d4e715c Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:07:39 -0800 Subject: [PATCH 43/58] Add verbose output for debugging --- .github/workflows/ios-custom-command-build-and-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 8578e0fa..56ddc794 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -135,3 +135,4 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} codecov_yml_path: ${{ github.workspace }}/codecov.yml + verbose: true From 7ab55fa046bb9e4532452517a2c9b7273d5803cb Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:13:05 -0800 Subject: [PATCH 44/58] Test passing directory --- .github/workflows/ios-build-and-test.yml | 4 ++++ .../ios-custom-command-build-and-test.yml | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index 28ebdcbd..7ae0f99b 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -53,6 +53,10 @@ on: run-build-xcframework-and-app: type: boolean default: false + codecov-directory: + description: 'The directory where the coverage report is stored.' + type: string + default: '' jobs: validate-code: diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 56ddc794..117cb8ec 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -34,6 +34,14 @@ on: command: type: string required: true + codecov-directory: + description: 'The directory where the coverage report is stored.' + type: string + default: '' + codecov-flag: + description: 'The flag to pass to the codecov uploader.' + type: string + default: '' jobs: define-matrix: @@ -129,10 +137,12 @@ jobs: - name: Run ${{ inputs.command }} run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" - + - name: Upload Code Coverage uses: codecov/codecov-action@v4.6.0 with: token: ${{ secrets.CODECOV_TOKEN }} - codecov_yml_path: ${{ github.workspace }}/codecov.yml + codecov_yml_path: codecov.yml + directory: ${{ inputs.codecov-directory }} + flags: ${{ inputs.codecov-flag }} verbose: true From f475618cf4c47f2901ff4c57462039faa220bebd Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:33:16 -0800 Subject: [PATCH 45/58] disable test run - only codecov --- .github/workflows/ios-custom-command-build-and-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 117cb8ec..ff38bb5c 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -135,8 +135,8 @@ jobs: - name: Setup Dependencies uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - - name: Run ${{ inputs.command }} - run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" + # - name: Run ${{ inputs.command }} + # run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" - name: Upload Code Coverage uses: codecov/codecov-action@v4.6.0 From 1276c6d80edd00c949ad2e0d75964d86b40e8239 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:21:38 -0800 Subject: [PATCH 46/58] Fix pass through directory --- .github/workflows/ios-build-and-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index 7ae0f99b..4bde2aaa 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -72,6 +72,8 @@ jobs: ios-device-names: ${{ inputs.ios-device-names }} ios-versions: ${{ inputs.ios-versions }} command: make unit-test-ios + codecov-directory: ${{ inputs.codecov-directory }} + codecov-flag: unittest secrets: inherit test-ios-functional: From d8df135d1d095409a980941f4c52848ca67fff41 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:26:48 -0800 Subject: [PATCH 47/58] Reduce matrix runner parallelism to 1 Test different yaml path using current working directory --- .github/workflows/ios-custom-command-build-and-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index ff38bb5c..1ec6a96c 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -121,7 +121,7 @@ jobs: runs-on: macos-latest needs: define-matrix strategy: - max-parallel: 2 + max-parallel: 1 matrix: ios-device: ${{ fromJson(needs.define-matrix.outputs.ios-device-names) }} ios: ${{ fromJson(needs.define-matrix.outputs.ios-versions) }} @@ -142,7 +142,7 @@ jobs: uses: codecov/codecov-action@v4.6.0 with: token: ${{ secrets.CODECOV_TOKEN }} - codecov_yml_path: codecov.yml + codecov_yml_path: ./codecov.yml directory: ${{ inputs.codecov-directory }} flags: ${{ inputs.codecov-flag }} verbose: true From 3a4cff339c9414ea0e512cf8a77b0ea496e46379 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:32:44 -0800 Subject: [PATCH 48/58] Test wildcard xcresult --- .github/workflows/ios-custom-command-build-and-test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 1ec6a96c..c1f2785c 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -132,8 +132,8 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4.2.2 - - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github + # - name: Setup Dependencies + # uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github # - name: Run ${{ inputs.command }} # run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" @@ -145,4 +145,5 @@ jobs: codecov_yml_path: ./codecov.yml directory: ${{ inputs.codecov-directory }} flags: ${{ inputs.codecov-flag }} + files: "*.xcresult" verbose: true From c5c5c77d08030c0dd8f56e33e24eb9cee57590d8 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:41:39 -0800 Subject: [PATCH 49/58] try moving to dervieddata folder --- .../workflows/ios-custom-command-build-and-test.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index c1f2785c..f27c6360 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -137,13 +137,17 @@ jobs: # - name: Run ${{ inputs.command }} # run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" + - name: Copy Test Results to DerivedData + run: | + mkdir -p /Users/runner/Library/Developer/Xcode/DerivedData/Logs/Test/ + cp -R build/reports/iosIntegrationUpstreamResults.xcresult /Users/runner/Library/Developer/Xcode/DerivedData/Logs/Test/ - name: Upload Code Coverage uses: codecov/codecov-action@v4.6.0 with: token: ${{ secrets.CODECOV_TOKEN }} - codecov_yml_path: ./codecov.yml - directory: ${{ inputs.codecov-directory }} + # codecov_yml_path: ./codecov.yml + # directory: ${{ inputs.codecov-directory }} flags: ${{ inputs.codecov-flag }} - files: "*.xcresult" + # files: "*.xcresult" verbose: true From 6da50beb13cbfe9f9e5cff0fbdca7b7cf9b9319f Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:44:40 -0800 Subject: [PATCH 50/58] test different directory --- .github/workflows/ios-custom-command-build-and-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index f27c6360..fc8b4b0f 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -139,8 +139,8 @@ jobs: # run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" - name: Copy Test Results to DerivedData run: | - mkdir -p /Users/runner/Library/Developer/Xcode/DerivedData/Logs/Test/ - cp -R build/reports/iosIntegrationUpstreamResults.xcresult /Users/runner/Library/Developer/Xcode/DerivedData/Logs/Test/ + mkdir -p /Users/runner/Library/Developer/Xcode/DerivedData/ + cp -R build/reports/iosIntegrationUpstreamResults.xcresult /Users/runner/Library/Developer/Xcode/DerivedData/ - name: Upload Code Coverage uses: codecov/codecov-action@v4.6.0 From f374766f74cbf1803ca62977348d868dedfbf3db Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:46:39 -0800 Subject: [PATCH 51/58] test ls --- .github/workflows/ios-custom-command-build-and-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index fc8b4b0f..0aee0387 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -139,6 +139,8 @@ jobs: # run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" - name: Copy Test Results to DerivedData run: | + ls -al /Users/runner/Library/Developer/Xcode/DerivedData + ls -al build/reports/ mkdir -p /Users/runner/Library/Developer/Xcode/DerivedData/ cp -R build/reports/iosIntegrationUpstreamResults.xcresult /Users/runner/Library/Developer/Xcode/DerivedData/ From e94e87f292a13d0c8f51963e1d3c76e65d8bb865 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:54:50 -0800 Subject: [PATCH 52/58] update to run test --- .../ios-custom-command-build-and-test.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 0aee0387..f5c9f5ba 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -132,17 +132,17 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4.2.2 - # - name: Setup Dependencies - # uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github + - name: Setup Dependencies + uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github - # - name: Run ${{ inputs.command }} - # run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" + - name: Run ${{ inputs.command }} + run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" - name: Copy Test Results to DerivedData run: | ls -al /Users/runner/Library/Developer/Xcode/DerivedData - ls -al build/reports/ - mkdir -p /Users/runner/Library/Developer/Xcode/DerivedData/ - cp -R build/reports/iosIntegrationUpstreamResults.xcresult /Users/runner/Library/Developer/Xcode/DerivedData/ + # ls -al build/reports/ + # mkdir -p /Users/runner/Library/Developer/Xcode/DerivedData/ + # cp -R build/reports/iosIntegrationUpstreamResults.xcresult /Users/runner/Library/Developer/Xcode/DerivedData/ - name: Upload Code Coverage uses: codecov/codecov-action@v4.6.0 From 549a8c5e4df4becb422f5a20592babe652ae743d Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 17:26:43 -0800 Subject: [PATCH 53/58] Remove codecov directory input Apply codecov flag and secrets passing to all test jobs --- .github/workflows/ios-build-and-test.yml | 17 +++++++++++------ .../ios-custom-command-build-and-test.yml | 14 +------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index 4bde2aaa..7b6bda91 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -53,10 +53,6 @@ on: run-build-xcframework-and-app: type: boolean default: false - codecov-directory: - description: 'The directory where the coverage report is stored.' - type: string - default: '' jobs: validate-code: @@ -72,8 +68,7 @@ jobs: ios-device-names: ${{ inputs.ios-device-names }} ios-versions: ${{ inputs.ios-versions }} command: make unit-test-ios - codecov-directory: ${{ inputs.codecov-directory }} - codecov-flag: unittest + codecov-flag: ios-unit-tests secrets: inherit test-ios-functional: @@ -85,6 +80,8 @@ jobs: ios-device-names: ${{ inputs.ios-device-names }} ios-versions: ${{ inputs.ios-versions }} command: make functional-test-ios + codecov-flag: ios-functional-tests + secrets: inherit test-ios-integration: name: Integration Test (iOS) @@ -95,6 +92,8 @@ jobs: ios-device-names: ${{ inputs.ios-device-names }} ios-versions: ${{ inputs.ios-versions }} command: make test-integration-upstream + codecov-flag: ios-integration-tests + secrets: inherit test-tvos-unit: name: Unit Test (tvOS) @@ -105,6 +104,8 @@ jobs: tvos-device-names: ${{ inputs.tvos-device-names }} tvos-versions: ${{ inputs.tvos-versions }} command: make unit-test-tvos + codecov-flag: tvos-unit-tests + secrets: inherit test-tvos-functional: name: Functional Test (tvOS) @@ -115,6 +116,8 @@ jobs: tvos-device-names: ${{ inputs.tvos-device-names }} tvos-versions: ${{ inputs.tvos-versions }} command: make functional-test-tvos + codecov-flag: tvos-functional-tests + secrets: inherit test-tvos-integration: name: Integration Test (tvOS) @@ -125,6 +128,8 @@ jobs: tvos-device-names: ${{ inputs.tvos-device-names }} tvos-versions: ${{ inputs.tvos-versions }} command: make integration-test-tvos + codecov-flag: tvos-integration-tests + secrets: inherit build_xcframework_and_app: name: Build XCFramework and Test App diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index f5c9f5ba..5b8775e1 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -34,10 +34,6 @@ on: command: type: string required: true - codecov-directory: - description: 'The directory where the coverage report is stored.' - type: string - default: '' codecov-flag: description: 'The flag to pass to the codecov uploader.' type: string @@ -137,19 +133,11 @@ jobs: - name: Run ${{ inputs.command }} run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" - - name: Copy Test Results to DerivedData - run: | - ls -al /Users/runner/Library/Developer/Xcode/DerivedData - # ls -al build/reports/ - # mkdir -p /Users/runner/Library/Developer/Xcode/DerivedData/ - # cp -R build/reports/iosIntegrationUpstreamResults.xcresult /Users/runner/Library/Developer/Xcode/DerivedData/ - name: Upload Code Coverage uses: codecov/codecov-action@v4.6.0 with: token: ${{ secrets.CODECOV_TOKEN }} - # codecov_yml_path: ./codecov.yml - # directory: ${{ inputs.codecov-directory }} + codecov_yml_path: ./codecov.yml flags: ${{ inputs.codecov-flag }} - # files: "*.xcresult" verbose: true From f49410f7bdf8eda1e566df423ee0d72ed217d3bc Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 17:30:13 -0800 Subject: [PATCH 54/58] Create toggle for enabling codecov with default to true Remove codecov yaml path --- .github/workflows/ios-build-and-test.yml | 10 ++++++++++ .../workflows/ios-custom-command-build-and-test.yml | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index 7b6bda91..b78f5b49 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -53,6 +53,10 @@ on: run-build-xcframework-and-app: type: boolean default: false + enable-codecov: + description: 'Enable Codecov for test coverage.' + type: boolean + default: true jobs: validate-code: @@ -68,6 +72,7 @@ jobs: ios-device-names: ${{ inputs.ios-device-names }} ios-versions: ${{ inputs.ios-versions }} command: make unit-test-ios + enable-codecov: ${{ inputs.enable-codecov }} codecov-flag: ios-unit-tests secrets: inherit @@ -80,6 +85,7 @@ jobs: ios-device-names: ${{ inputs.ios-device-names }} ios-versions: ${{ inputs.ios-versions }} command: make functional-test-ios + enable-codecov: ${{ inputs.enable-codecov }} codecov-flag: ios-functional-tests secrets: inherit @@ -92,6 +98,7 @@ jobs: ios-device-names: ${{ inputs.ios-device-names }} ios-versions: ${{ inputs.ios-versions }} command: make test-integration-upstream + enable-codecov: ${{ inputs.enable-codecov }} codecov-flag: ios-integration-tests secrets: inherit @@ -104,6 +111,7 @@ jobs: tvos-device-names: ${{ inputs.tvos-device-names }} tvos-versions: ${{ inputs.tvos-versions }} command: make unit-test-tvos + enable-codecov: ${{ inputs.enable-codecov }} codecov-flag: tvos-unit-tests secrets: inherit @@ -116,6 +124,7 @@ jobs: tvos-device-names: ${{ inputs.tvos-device-names }} tvos-versions: ${{ inputs.tvos-versions }} command: make functional-test-tvos + enable-codecov: ${{ inputs.enable-codecov }} codecov-flag: tvos-functional-tests secrets: inherit @@ -128,6 +137,7 @@ jobs: tvos-device-names: ${{ inputs.tvos-device-names }} tvos-versions: ${{ inputs.tvos-versions }} command: make integration-test-tvos + enable-codecov: ${{ inputs.enable-codecov }} codecov-flag: tvos-integration-tests secrets: inherit diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 5b8775e1..9c7c77c4 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -34,6 +34,10 @@ on: command: type: string required: true + enable-codecov: + description: 'Enable Codecov for test coverage.' + type: boolean + default: true codecov-flag: description: 'The flag to pass to the codecov uploader.' type: string @@ -135,9 +139,9 @@ jobs: run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" - name: Upload Code Coverage + if: ${{ inputs.enable-codecov }} uses: codecov/codecov-action@v4.6.0 with: token: ${{ secrets.CODECOV_TOKEN }} - codecov_yml_path: ./codecov.yml flags: ${{ inputs.codecov-flag }} verbose: true From 00c7d83f639768d432169a15c0c4f66117269ffb Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Wed, 6 Nov 2024 17:48:41 -0800 Subject: [PATCH 55/58] Apply production configuration values --- .github/workflows/ios-build-and-test.yml | 16 ++++++++-------- .../ios-custom-command-build-and-test.yml | 2 +- .github/workflows/ios-validate-code.yml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ios-build-and-test.yml b/.github/workflows/ios-build-and-test.yml index b78f5b49..8eae5240 100644 --- a/.github/workflows/ios-build-and-test.yml +++ b/.github/workflows/ios-build-and-test.yml @@ -61,13 +61,13 @@ on: jobs: validate-code: name: Validate Code - uses: timkimadobe/aepsdk-commons/.github/workflows/ios-validate-code.yml@ios-circleci-to-github + uses: adobe/aepsdk-commons/.github/workflows/ios-validate-code.yml@gha-ios-5.0.0 test-ios-unit: name: Unit Test (iOS) needs: validate-code if: inputs.run-test-ios-unit - uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github + uses: adobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@gha-ios-5.0.0 with: ios-device-names: ${{ inputs.ios-device-names }} ios-versions: ${{ inputs.ios-versions }} @@ -80,7 +80,7 @@ jobs: name: Functional Test (iOS) needs: validate-code if: inputs.run-test-ios-functional - uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github + uses: adobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@gha-ios-5.0.0 with: ios-device-names: ${{ inputs.ios-device-names }} ios-versions: ${{ inputs.ios-versions }} @@ -93,7 +93,7 @@ jobs: name: Integration Test (iOS) needs: validate-code if: inputs.run-test-ios-integration - uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github + uses: adobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@gha-ios-5.0.0 with: ios-device-names: ${{ inputs.ios-device-names }} ios-versions: ${{ inputs.ios-versions }} @@ -106,7 +106,7 @@ jobs: name: Unit Test (tvOS) needs: validate-code if: inputs.run-test-tvos-unit - uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github + uses: adobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@gha-ios-5.0.0 with: tvos-device-names: ${{ inputs.tvos-device-names }} tvos-versions: ${{ inputs.tvos-versions }} @@ -119,7 +119,7 @@ jobs: name: Functional Test (tvOS) needs: validate-code if: inputs.run-test-tvos-functional - uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github + uses: adobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@gha-ios-5.0.0 with: tvos-device-names: ${{ inputs.tvos-device-names }} tvos-versions: ${{ inputs.tvos-versions }} @@ -132,7 +132,7 @@ jobs: name: Integration Test (tvOS) needs: validate-code if: inputs.run-test-tvos-integration - uses: timkimadobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@ios-circleci-to-github + uses: adobe/aepsdk-commons/.github/workflows/ios-custom-command-build-and-test.yml@gha-ios-5.0.0 with: tvos-device-names: ${{ inputs.tvos-device-names }} tvos-versions: ${{ inputs.tvos-versions }} @@ -152,7 +152,7 @@ jobs: uses: actions/checkout@v4.2.2 - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github + uses: adobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-ios-5.0.0 - name: Build XCFramework run: make archive diff --git a/.github/workflows/ios-custom-command-build-and-test.yml b/.github/workflows/ios-custom-command-build-and-test.yml index 9c7c77c4..6d455589 100644 --- a/.github/workflows/ios-custom-command-build-and-test.yml +++ b/.github/workflows/ios-custom-command-build-and-test.yml @@ -133,7 +133,7 @@ jobs: uses: actions/checkout@v4.2.2 - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github + uses: adobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-ios-5.0.0 - name: Run ${{ inputs.command }} run: ${{ inputs.command }} IOS_DEVICE_NAME="${{ matrix.ios-device }}" IOS_VERSION="${{ matrix.ios }}" TVOS_DEVICE_NAME="${{ matrix.tvos-device }}" TVOS_VERSION="${{ matrix.tvos }}" diff --git a/.github/workflows/ios-validate-code.yml b/.github/workflows/ios-validate-code.yml index 22cf6644..4e63a403 100644 --- a/.github/workflows/ios-validate-code.yml +++ b/.github/workflows/ios-validate-code.yml @@ -13,7 +13,7 @@ jobs: uses: actions/checkout@v4.2.2 - name: Setup Dependencies - uses: timkimadobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@ios-circleci-to-github + uses: adobe/aepsdk-commons/.github/actions/ios-setup-dependencies-action@gha-ios-5.0.0 - name: Lint Source Code run: make lint From 58fee3594e23b37fdefca3d70455715266a994c2 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:15:49 -0800 Subject: [PATCH 56/58] Update workflow README with iOS build and test workflow requirements --- .github/workflows/workflows.md | 69 +++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 10 deletions(-) diff --git a/.github/workflows/workflows.md b/.github/workflows/workflows.md index 0262bfc7..aac65533 100644 --- a/.github/workflows/workflows.md +++ b/.github/workflows/workflows.md @@ -7,6 +7,9 @@ This document covers how to use the workflows in Commons, and explains their req - [Workflow booleans](#workflow-booleans) - [Secrets handling in reusable workflows](#secrets-handling-in-reusable-workflows) - [Implementing logical operations](#implementing-logical-operations) +- [General workflows](#general-workflows) + - [Versions – update or validate (versions.yml)](#versions--update-or-validate-versionsyml) +- [Android workflows](#android-workflows) - [Android Maven release (android-maven-release.yml)](#android-maven-release-android-maven-releaseyml) - [Overview](#overview) - [Inputs](#inputs) @@ -16,10 +19,14 @@ This document covers how to use the workflows in Commons, and explains their req - [Inputs](#inputs-1) - [Secrets required](#secrets-required-1) - [Makefile requirements](#makefile-requirements-1) +- [iOS workflows](#ios-workflows) - [iOS release (ios-release.yml)](#ios-release-ios-releaseyml) - [Secrets required](#secrets-required-2) - [Makefile requirements](#makefile-requirements-2) - - [Versions – update or validate (versions.yml)](#versions--update-or-validate-versionsyml) + - [iOS build and test (ios-build-and-test.yml)](#ios-build-and-test-ios-build-and-testyml) + - [Requirements](#requirements) + - [Secrets required](#secrets-required-3) + - [Makefile requirements](#makefile-requirements-3) ## General caller workflow tips @@ -45,6 +52,18 @@ GitHub Actions does not support true ternary operations within `${{ }}` expressi Refer to the [GitHub documentation on evaluating expressions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#example) for examples. +# General workflows + +## Versions – update or validate (versions.yml) + +The update action automatically creates a pull request (PR), which requires the following GitHub repository settings: + +1. Navigate to **Settings** -> **Code and automation** -> **Actions** -> **General** +2. Under **Workflow permissions**, select: + - **Allow GitHub Actions to create and approve pull requests** + +# Android workflows + ## Android Maven release (android-maven-release.yml) ### Overview @@ -111,6 +130,8 @@ The Makefile in the caller repository must include the following rules: - `` is provided as the workflow input: `release-variant` - Example: `core-publish-snapshot`, `signal-publish-snapshot` +# iOS workflows + ## iOS release (ios-release.yml) ### Secrets required @@ -123,15 +144,43 @@ Pass the required secrets using `secrets: inherit` from the caller workflow. The Makefile in the caller repository must include the following rules: - `make check-version VERSION=` -- `make test-SPM-integration` -- `make test-podspec` -- `make archive` -- `make zip` +- If `create-github-release` is `true`: + - `make test-SPM-integration` + - Requires local `test-SPM.sh` + - `make test-podspec` + - Requires local `test-podspec.sh` + - `make archive` + - `make zip` -## Versions – update or validate (versions.yml) +## iOS build and test (ios-build-and-test.yml) -The update action automatically creates a pull request (PR), which requires the following GitHub repository settings: +### Requirements +In order for Xcode code coverage to be uploaded by Codecov, Makefile test rules run using this workflow **must not** override the default location using the `-resultBundlePath` flag (ex: `-resultBundlePath build/reports/iosUnitResults.xcresult`). -1. Navigate to **Settings** -> **Code and automation** -> **Actions** -> **General** -2. Under **Workflow permissions**, select: - - **Allow GitHub Actions to create and approve pull requests** +The default base path that the Codecov action will look for test results on the GitHub Action runner is: +`/Users/runner/Library/Developer/Xcode/DerivedData` + +### Secrets required +Pass the required secrets using `secrets: inherit` from the caller workflow. + +- `CODECOV_TOKEN`: Used by Codecov to upload code coverage reports. + +### Makefile requirements +The Makefile in the caller repository must include the following rules: + +- `make lint` +- When `run-test-ios-unit` is `true`: + - `make unit-test-ios` +- When `run-test-ios-functional` is `true`: + - `make functional-test-ios` +- When `run-test-ios-integration` is `true`: + - `make test-integration-upstream` +- When `run-test-tvos-unit` is `true`: + - `make unit-test-tvos` +- When `run-test-tvos-functional` is `true`: + - `make functional-test-tvos` +- When `run-test-tvos-integration` is `true`: + - `make integration-test-tvos` +- When `run-build-xcframework-and-app` is `true`: + - `make archive` + - `make build-app` \ No newline at end of file From 7eb0a4d36e47ddc078c5c0fc41c901926cd78eb4 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:30:55 -0800 Subject: [PATCH 57/58] Update build and test Makefile docs for matrix compatibility --- .github/workflows/workflows.md | 36 +++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflows.md b/.github/workflows/workflows.md index aac65533..34c26a1c 100644 --- a/.github/workflows/workflows.md +++ b/.github/workflows/workflows.md @@ -183,4 +183,38 @@ The Makefile in the caller repository must include the following rules: - `make integration-test-tvos` - When `run-build-xcframework-and-app` is `true`: - `make archive` - - `make build-app` \ No newline at end of file + - `make build-app` + +For device and OS matrix to work, the Makefile must support four new input properties: +- `IOS_DEVICE_NAME` +- `IOS_VERSION` +- `TVOS_DEVICE_NAME` +- `TVOS_VERSION` + +```makefile +# At the top level of the Makefile: +# Values with defaults +IOS_DEVICE_NAME ?= iPhone 15 +# If OS version is not specified, uses the first device name match in the list of available simulators +IOS_VERSION ?= +ifeq ($(strip $(IOS_VERSION)),) + IOS_DESTINATION = "platform=iOS Simulator,name=$(IOS_DEVICE_NAME)" +else + IOS_DESTINATION = "platform=iOS Simulator,name=$(IOS_DEVICE_NAME),OS=$(IOS_VERSION)" +endif + +TVOS_DEVICE_NAME ?= Apple TV +# If OS version is not specified, uses the first device name match in the list of available simulators +TVOS_VERSION ?= +ifeq ($(strip $(TVOS_VERSION)),) + TVOS_DESTINATION = "platform=tvOS Simulator,name=$(TVOS_DEVICE_NAME)" +else + TVOS_DESTINATION = "platform=tvOS Simulator,name=$(TVOS_DEVICE_NAME),OS=$(TVOS_VERSION)" +endif + +... + +# Usage example - update the `-destination` flag to use the new computed property `IOS_DESTINATION`: +xcodebuild test -workspace $(PROJECT_NAME).xcworkspace -scheme "UnitTests" -destination $(IOS_DESTINATION) -enableCodeCoverage YES ADB_SKIP_LINT=YES + +``` \ No newline at end of file From 2dcd4b8c63851363873cba09f4d26584bda08870 Mon Sep 17 00:00:00 2001 From: timkimadobe <95260439+timkimadobe@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:34:14 -0800 Subject: [PATCH 58/58] Update iOS release workflow README --- .github/workflows/workflows.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/workflows.md b/.github/workflows/workflows.md index 34c26a1c..b991c177 100644 --- a/.github/workflows/workflows.md +++ b/.github/workflows/workflows.md @@ -152,6 +152,9 @@ The Makefile in the caller repository must include the following rules: - `make archive` - `make zip` +The GitHub release job will look for the `.xcframework.zip` files using the pattern: +`./build/${DEP}.xcframework.zip#${DEP}-${DEP_VERSION}.xcframework.zip"` + ## iOS build and test (ios-build-and-test.yml) ### Requirements