-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #519 from adobe/staging
`staging` -> `main` [NON-RELEASE] Integration test workflow updates
- Loading branch information
Showing
2 changed files
with
24 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,83 +51,31 @@ on: | |
- 'EmptyString' | ||
- 'Invalid' | ||
- 'None' | ||
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 | ||
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: '["18.0"]' | ||
|
||
|
||
run-name: ${{ inputs.id }} | ||
|
||
jobs: | ||
test-integration-upstream: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Job run identifier ${{ github.event.inputs.id }} | ||
id: job-run-identifier | ||
run: | | ||
if [ -z "${{ github.event.inputs.id }}" ]; then \ | ||
echo No job run identifier was set. | ||
else | ||
echo 'Job run identifier is:' ${{ inputs.id }} | ||
fi; | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
|
||
- name: Cache Cocoapods | ||
id: cache-cocoapods | ||
uses: actions/[email protected] | ||
with: | ||
path: Pods | ||
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-pods- | ||
- name: Execute Edge Network integration tests | ||
id: execute-integration-tests | ||
run: make test-integration-upstream TAGS_MOBILE_PROPERTY_ID=${{ github.event.inputs.tags-mobile-property-id }} EDGE_LOCATION_HINT=${{ github.event.inputs.edge-location-hint }} | ||
|
||
# Potential workflow solutions on job failure | ||
# All workflow setup step failures give exit code 2, with 3 as fallback | ||
# Actual integration test failures give exit code 1 | ||
- name: On failure | ||
id: on-failure | ||
if: ${{ failure() }} | ||
env: | ||
BRANCH: ${{ github.event.inputs.branch }} | ||
run: | | ||
echo "Job used branch: $BRANCH. Please make sure this is the branch to run off of." | ||
EXIT_CODE=3 | ||
if [[ "${{ steps.job-run-identifier.conclusion }}" == "failure" ]]; then | ||
echo "Job step failed: Job run identifier." | ||
EXIT_CODE=2 | ||
elif [[ "${{ steps.checkout.conclusion }}" == "failure" ]]; then | ||
echo "Job step failed: Checkout." | ||
EXIT_CODE=2 | ||
elif [[ "${{ steps.cache-cocoapods.conclusion }}" == "failure" ]]; then | ||
echo "Job step failed: Cache Cocoapods." | ||
EXIT_CODE=2 | ||
elif [[ "${{ steps.execute-integration-tests.conclusion }}" == "failure" ]]; then | ||
echo "Job step failed: Execute Edge Network integration tests." | ||
EXIT_CODE=1 | ||
else | ||
echo "Job failed: Failure cause not identified." | ||
fi | ||
echo "EXIT_CODE=$EXIT_CODE" >> $GITHUB_OUTPUT | ||
# Dynamic step name in JSON format, examples on job: | ||
# - During job run (before this step): {"exitCode":${{ steps.on-failure.outputs.EXIT_CODE || 0 }}} | ||
# - Failure: {"exitCode":1} | ||
# - Success: {"exitCode":0} | ||
- name: "{\"exitCode\":${{ steps.on-failure.outputs.EXIT_CODE || 0 }}}" | ||
id: failure-data | ||
if: ${{ failure() }} | ||
run: | | ||
echo 'exit code in the body: ${{ steps.on-failure.outputs.EXIT_CODE }}' | ||
echo 'on-failure outputs: ${{ toJson(steps.on-failure.outputs) }}' | ||
|
||
test-ios-integration: | ||
name: Integration Test (iOS) | ||
uses: adobe/aepsdk-commons/.github/workflows/[email protected] | ||
with: | ||
ios-device-names: ${{ inputs.ios-device-names }} | ||
ios-versions: ${{ inputs.ios-versions }} | ||
command: make integration-test-ios TAGS_MOBILE_PROPERTY_ID=${{ github.event.inputs.tags-mobile-property-id }} EDGE_LOCATION_HINT=${{ github.event.inputs.edge-location-hint }} | ||
enable-codecov: false | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters