Skip to content

Commit e2c1b0a

Browse files
Merge branch 'dev' into feature/aks-vcpkg
2 parents a247075 + b776d8b commit e2c1b0a

File tree

5 files changed

+435
-61
lines changed

5 files changed

+435
-61
lines changed

.github/workflows/cpp-packaging.yml

Lines changed: 72 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
description: 'public version # to test against'
1616
downloadPreviousRun:
1717
description: 'previous run # to test against'
18+
runIntegrationTests:
19+
description: 'run integration tests?'
20+
default: 0
1821

1922
env:
2023
# Packaging prerequisites
@@ -601,45 +604,75 @@ jobs:
601604
firebase-cpp-sdk-android-c++-package
602605
failOnError: false
603606

604-
run_integration_tests:
605-
name: run-integration-tests
607+
tests:
606608
needs: [merge_packages, download_sdk_package]
607-
if: always()
608-
runs-on: ubuntu-latest
609+
if: github.event.inputs.runIntegrationTests != 0 && !cancelled()
610+
runs-on: ${{ matrix.os }}
611+
strategy:
612+
matrix:
613+
os: [ubuntu-latest, macos-latest, windows-latest]
614+
target_platform: [Desktop, Android, iOS]
615+
exclude:
616+
- os: ubuntu-latest
617+
target_platform: iOS
618+
- os: windows-latest
619+
target_platform: iOS
620+
fail-fast: false
621+
env:
622+
apis: admob,analytics,auth,database,dynamic_links,firestore,functions,instance_id,messaging,remote_config,storage
623+
android_device: flame
624+
android_api: 29
625+
ios_device: iphone11pro
626+
ios_version: 13.3
609627
steps:
610-
- name: setup Xcode version (macos)
611-
if: runner.os == 'macOS'
612-
run: sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
613-
614-
- name: download SDK zip
615-
uses: actions/download-artifact@v2
616-
with:
617-
name: firebase_cpp_sdk.zip
618-
path: .
619-
620-
- name: download hash
621-
uses: actions/download-artifact@v2
622-
with:
623-
name: firebase_cpp_sdk_hash.txt
624-
path: .
625-
626-
- name: List binary SDK files.
627-
run: |
628-
# Verify zipfile hash first.
629-
${{ env.hashCommand }} -c --quiet firebase_cpp_sdk_hash.txt
628+
- name: Checkout repo
629+
uses: actions/[email protected]
630+
with:
631+
ref: ${{ github.event.inputs.commitIdToPackage }}
632+
- name: Setup Xcode version (macos)
633+
if: runner.os == 'macOS'
634+
run: sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
635+
- name: Download Firebase C++ SDK
636+
uses: actions/download-artifact@v2
637+
with:
638+
name: firebase_cpp_sdk.zip
639+
- name: Unzip Firebase C++ SDK
640+
shell: bash
641+
run: |
642+
ls
643+
if [ "$RUNNER_OS" == "Windows" ]; then
644+
7z x firebase_cpp_sdk.zip
645+
else
630646
unzip -q firebase_cpp_sdk.zip
631-
find . -print
632-
633-
- name: Verify SDK package files.
634-
run: |
635-
if [[ -r firebase_cpp_sdk/file_hashes.txt ]]; then
636-
${{ env.hashCommand }} -c --quiet firebase_cpp_sdk/file_hashes.txt
637-
else
638-
echo "::warning ::SDK package does not contain file_hashes.txt, cannot verify files in package."
639-
fi
640-
641-
- name: fetch integration test source
642-
uses: actions/[email protected]
643-
with:
644-
path: src
645-
ref: ${{ github.event.inputs.commitIdToPackage }}
647+
fi
648+
- name: Setup python
649+
uses: actions/setup-python@v2
650+
with:
651+
python-version: '3.7'
652+
- name: Add msbuild to PATH (windows)
653+
if: runner.os == 'Windows'
654+
uses: microsoft/[email protected]
655+
- name: Prepare for integration tests
656+
run: |
657+
pip install -r scripts/gha/requirements.txt
658+
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
659+
- name: Build integration tests (and run Desktop tests)
660+
run: |
661+
python scripts/gha/build_testapps.py --t ${{ env.apis }} --p ${{ matrix.target_platform }} --sdk_dir firebase_cpp_sdk --output_directory ${{ github.workspace }} --execute_desktop_testapp --noadd_timestamp
662+
663+
# Workaround for https://github.com/GoogleCloudPlatform/github-actions/issues/100
664+
# Must be run after the Python setup action
665+
- name: Set CLOUDSDK_PYTHON (Windows)
666+
if: runner.os == 'Windows' && !cancelled()
667+
run: echo "CLOUDSDK_PYTHON=${{env.pythonLocation}}\python.exe" >> $GITHUB_ENV
668+
- name: Install Cloud SDK
669+
if: ${{ !cancelled() }}
670+
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
671+
- name: Upload Desktop Artifacts to GCS
672+
if: ${{ !cancelled() }}
673+
run: |
674+
python scripts/gha/gcs_uploader.py --testapp_dir testapps --key_file scripts/gha-encrypted/gcs_key_file.json
675+
- name: Run mobile integration tests
676+
if: matrix.target_platform != 'Desktop' && !cancelled()
677+
run: |
678+
python scripts/gha/test_lab.py --android_model ${{ env.android_device }} --android_api ${{ env.android_api }} --ios_model ${{ env.ios_device }} --ios_version ${{ env.ios_version }} --testapp_dir testapps --code_platform cpp --key_file scripts/gha-encrypted/gcs_key_file.json

.github/workflows/integration_tests.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
inputs:
66
platforms:
77
description: 'CSV of Desktop, Android and/or iOS'
8-
default: 'Desktop'
8+
default: 'Desktop,Android,iOS'
99
required: true
1010
apis:
1111
description: 'CSV of apis to build and test'
@@ -117,9 +117,6 @@ jobs:
117117
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
118118
119119
- name: Build integration tests (and run Desktop tests)
120-
# The set up script for Android will download the NDK here.
121-
env:
122-
NDK_ROOT: '/tmp/android-ndk-r16b'
123120
run: |
124121
python scripts/gha/build_testapps.py --t ${{ github.event.inputs.apis }} --p ${{ matrix.target_platform }} --output_directory ${{ github.workspace }} --use_vcpkg --execute_desktop_testapp --noadd_timestamp
125122

0 commit comments

Comments
 (0)