Skip to content

Update pre-release-qa.yml #1284

Update pre-release-qa.yml

Update pre-release-qa.yml #1284

name: Pre Release SDK Integration Tests
on: [push]
jobs:
verify-cocoapods-iOS:
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_DEV_CERT }}
P12_PASSWORD: ${{ secrets.APPLE_DEV_CERT_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
# import certificate
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# Create Provisioning Profiles
echo "${{ secrets.BS_DEV_BUILD_PROVISION_PROFILE_BASE64_PART_AA }}" >> part_aa
echo "${{ secrets.BS_DEV_BUILD_PROVISION_PROFILE_BASE64_PART_AB }}" >> part_aa
echo "${{ secrets.BS_DEV_BUILD_PROVISION_PROFILE_BASE64_PART_AC }}" >> part_aa
base64 -D -i part_aa > $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles
cp $PP_PATH ~/Library/Developer/Xcode/UserData/Provisioning\ Profiles/
- name: Install pod, build project and run tests
run: |
mkdir -p test-results
echo "branch=${{ github.ref }}" >> $GITHUB_OUTPUT
cd SDKIntegrationTestApps/iOSReleaseTest-Cocoapods/
pod install
xcodebuild -configuration Debug \
-scheme iOSReleaseTest -workspace iOSReleaseTest.xcworkspace \
-sdk iphonesimulator \
-destination "platform='iOS Simulator',OS=latest,name=iPhone 15" \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
PROVISIONING_PROFILE_SPECIFIER="" \
DEVELOPMENT_TEAM="" \
-resultBundlePath ../../test-results/ios-cocoapods.xcresult \
clean test
- name: Upload test report
uses: actions/upload-artifact@v4
if: always()
with:
name: test-report-cocoapods-iOS
path: test-results
verify-carthage-iOS:
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Create Cart File, run carthage command, build project and run tests
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
mkdir -p test-results
CURR_DIR=$(PWD)
./scripts/getSimulator
DESTINATION="platform=iOS Simulator,name=$(cat ./iphoneSim),OS=latest"
cd SDKIntegrationTestApps/iOSReleaseTest-Carthage/
echo "git \"file://${CURR_DIR}\" \"$BRANCH_NAME\" " >> cartfile
carthage update --use-xcframeworks
xcodebuild test -scheme iOSReleaseTest -project iOSReleaseTest.xcodeproj -destination "$DESTINATION" -resultBundlePath ../../test-results/ios-carthage.xcresult
- name: Upload test report
uses: actions/upload-artifact@v4
if: always()
with:
name: test-report-carthage-iOS
path: test-results
verify-SPM-iOS:
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Check out code
uses: actions/checkout@v4
- name: build project and run tests
run: |
mkdir -p test-results
./scripts/getSimulator
DESTINATION="platform=iOS Simulator,name=$(cat ./iphoneSim),OS=latest"
cd SDKIntegrationTestApps/iOSReleaseTest-SPM/
xcodebuild test -scheme iOSReleaseTest -project iOSReleaseTest.xcodeproj -destination "$DESTINATION" -resultBundlePath ../../test-results/ios-spm.xcresult
- name: Upload test report
uses: actions/upload-artifact@v4
if: always()
with:
name: test-report-spm-iOS
path: test-results
verify-manually-with-xcframework-iOS:
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Check out code
uses: actions/checkout@v4
- name: build xcframework, then build project and run tests
run: |
mkdir -p test-results
./scripts/getSimulator
DESTINATION="platform=iOS Simulator,name=$(cat ./iphoneSim),OS=latest"
xcodebuild -scheme xcframework
cd SDKIntegrationTestApps/iOSReleaseTest-Manual/
xcodebuild test -scheme iOSReleaseTest -project iOSReleaseTest.xcodeproj -destination "$DESTINATION" -resultBundlePath ../../test-results/ios-xcframework.xcresult
- name: Upload test report
uses: actions/upload-artifact@v4
if: always()
with:
name: test-report-manual-xcframework-iOS
path: test-results
verify-manually-with-StaticFramework-iOS:
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Check out code
uses: actions/checkout@v4
- name: build static xcframework, then build project and run tests
run: |
mkdir -p test-results
./scripts/getSimulator
DESTINATION="platform=iOS Simulator,name=$(cat ./iphoneSim),OS=latest"
xcodebuild -scheme static-xcframework
cd SDKIntegrationTestApps/iOSReleaseTest-Manual-Static/
xcodebuild test -scheme iOSReleaseTest -project iOSReleaseTest.xcodeproj -destination "$DESTINATION" -resultBundlePath ../../test-results/ios-static-framework.xcresult
- name: Upload test report
uses: actions/upload-artifact@v4
if: always()
with:
name: test-report-manual-static-iOS
path: test-results
verify-cocoapods-tvOS:
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install pod, build project and run tests
run: |
mkdir -p test-results
./scripts/getSimulator
DESTINATION="platform=tvOS Simulator,name=$(cat ./appleTVSim),OS=latest"
cd SDKIntegrationTestApps/tvOSReleaseTest-Cocoapods/
pod install
xcodebuild test -scheme tvOSReleaseTest -workspace tvOSReleaseTest.xcworkspace -destination "$DESTINATION" -resultBundlePath ../../test-results/tvOS-cocoapods.xcresult
- name: Upload test report
uses: actions/upload-artifact@v4
if: always()
with:
name: test-report-cocoapods-tvOS
path: test-results
verify-carthage-tvOS:
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Verify Integration using Carthage for tvOS
run: |
mkdir -p test-results
./scripts/getSimulator
DESTINATION="platform=tvOS Simulator,name=$(cat ./appleTVSim),OS=latest"
cd SDKIntegrationTestApps/tvOSReleaseTest-Carthage/
echo "Skipping it ... its broken"
verify-manually-with-xcframework-tvOS:
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Check out code
uses: actions/checkout@v4
- name: build xcframework, then build project and run tests
run: |
mkdir -p test-results
./scripts/getSimulator
DESTINATION="platform=tvOS Simulator,name=$(cat ./appleTVSim),OS=latest"
xcodebuild -scheme xcframework
cd SDKIntegrationTestApps/tvOSReleaseTest-Manual/
xcodebuild test -scheme tvOSReleaseTest -project tvOSReleaseTest.xcodeproj -destination "$DESTINATION" -resultBundlePath ../../test-results/tvOS-xcframework.xcresult
- name: Upload test report
uses: actions/upload-artifact@v4
if: always()
with:
name: test-report-manual-xcframework-tvOS
path: test-results