tests-ui-sample-app-firebase #20
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
name: tests-ui-sample-app-firebase | |
on: | |
workflow_dispatch: | |
jobs: | |
ui-tests: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Select Xcode version | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '15.4.0' | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.3.0 | |
bundler-cache: true | |
- name: Install dependencies | |
run: pod install | |
- name: Decode and create GoogleService-Info.plist | |
run: echo $TEST_UI_FIREBASE_PLIST_BASE64 | base64 --decode > TelnyxWebRTCDemo/GoogleService-Info.plist | |
- name: Verify GoogleService-Info.plist | |
run: | | |
if [ ! -f TelnyxWebRTCDemo/GoogleService-Info.plist ]; then | |
echo "GoogleService-Info.plist not found!" | |
exit 1 | |
fi | |
- name: Set up environment | |
run: | | |
sh scripts/setup_uitest_env.sh \ | |
-u "${{ secrets.TEST_UI_SIP_USER }}" \ | |
-p "${{ secrets.TEST_UI_SIP_PASSWORD }}" \ | |
-t "${{ secrets.TEST_UI_SIP_TOKEN }}" \ | |
-d "${{ secrets.TEST_UI_DESTINATION_NUMBER }}" \ | |
-c "${{ secrets.TEST_IU_CALLER_NUMBER }}" | |
- name: Authenticate with Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: '${{ secrets.TEST_UI_GCLOUD_SERVICE_KEY }}' | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
- name: Add signing certificates | |
run: | | |
echo "${{ secrets.APPLE_CERTIFICATE }}" | base64 --decode > certificate.p12 | |
security import certificate.p12 -P "${{ secrets.APPLE_CERTIFICATE_PASSWORD }}" -k ~/Library/Keychains/login.keychain-db | |
echo "${{ secrets.APPLE_PROVISIONING_PROFILE }}" | base64 --decode > provisioning_profile.mobileprovision | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
mv provisioning_profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/ | |
- name: Clean Xcode build cache | |
run: | | |
sudo xcodebuild -alltargets clean | |
sudo rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
- name: Disable UI prompts | |
run: | | |
sudo defaults write /Library/Preferences/com.apple.security.revocation CRLStyle None | |
sudo defaults write /Library/Preferences/com.apple.security.revocation OCSPStyle None | |
- name: Install xcpretty | |
run: gem install xcpretty | |
- name: Build UI Tests | |
run: | | |
xcodebuild build-for-testing \ | |
-workspace TelnyxRTC.xcworkspace \ | |
-scheme TelnyxWebRTCDemo \ | |
-sdk iphoneos \ | |
-configuration Debug \ | |
-destination 'generic/platform=iOS' \ | |
-derivedDataPath build \ | |
SUPPORTS_MACCATALYST=NO \ | |
-allowProvisioningUpdates \ | |
| xcpretty | |
- name: Create test zip | |
run: | | |
TEST_RUN_FILE=$(find build/Build/Products -name "*.xctestrun" | head -n 1) | |
zip -r TelnyxWebRTCDemoUITests.zip \ | |
build/Build/Products/Debug-iphoneos \ | |
"$TEST_RUN_FILE" | |
- name: Run tests on Firebase Test Lab | |
run: | | |
gcloud firebase test ios run \ | |
--test TelnyxWebRTCDemoUITests.zip \ | |
--device model=iphone14pro,version=16.6,locale=en_US,orientation=portrait | |
- name: Clean up environment | |
if: always() | |
run: | | |
security delete-keychain ~/Library/Keychains/login.keychain-db | |
rm -rf ~/Library/MobileDevice/Provisioning\ Profiles/provisioning_profile.mobileprovision | |
rm -f certificate.p12 |