Files
firebase-ios-sdk/.github/workflows/abtesting.yml
T
Maksym Malyhin de91df623b Don't run GHA on private repo until it is for a PR (#5849)
* Don't run ABTesting GHA on private repo unless for a PR

* Fix syntax

* Auth workflow

* Don't run GHA on private repo unless it is for a PR

* disable on push to master
2020-06-18 18:20:45 -04:00

127 lines
5.2 KiB
YAML

name: abtesting
on:
pull_request:
paths:
- 'FirebaseABTesting**'
- 'Interop/Analytics/Public/*.h'
- '.github/workflows/abtesting.yml'
- 'Gemfile'
schedule:
# Run every day at 3am (PST) - cron uses UTC times
# This is set to 3 hours after zip workflow finishes so zip testing can run after.
- cron: '0 11 * * *'
jobs:
pod-lib-lint:
# Don't run on private repo unless it is a PR.
if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
runs-on: macOS-latest
strategy:
matrix:
target: [ios, tvos, macos]
steps:
- uses: actions/checkout@v2
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Build and test
run: |
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseABTesting.podspec \
--platforms=${{ matrix.target }}
catalyst:
# Don't run on private repo unless it is a PR.
if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Setup project and Build for Catalyst
# Only build the unit tests on Catalyst. Test stopped working when GHA moved to Xcode 11.4.1.
run: scripts/test_catalyst.sh FirebaseABTesting build FirebaseABTesting-Unit-unit
quickstart_framework:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository != 'FirebasePrivate/firebase-ios-sdk'
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
FRAMEWORK_ZIP: "Firebase-actions-dir.zip"
SDK: "ABTesting"
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Pull zip from GCS
run: scripts/pull_zip_gcloud.sh "$plist_secret" "$FRAMEWORK_ZIP" "${HOME}/ios_frameworks"
- name: Setup quickstart
run: SAMPLE="$SDK" TARGET="${SDK}Example" scripts/setup_quickstart_framework.sh \
"${HOME}"/ios_frameworks/Firebase/FirebaseRemoteConfig/* \
"${HOME}"/ios_frameworks/Firebase/FirebaseMessaging/FirebaseInstanceID.xcframework \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseCore.xcframework \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/PromisesObjC.xcframework \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/FirebaseInstallations.xcframework \
"${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/GoogleUtilities.xcframework
- name: Install Secret GoogleService-Info.plist
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
- name: Install Secret FIREGSignInInfo.h
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/FIREGSignInInfo.h.gpg \
quickstart-ios/TestUtils/FIREGSignInInfo.h "$signin_secret"
- name: Test Quickstart
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_framework.sh "${SDK}")
- name: Remove data before upload
if: ${{ failure() }}
run: scripts/remove_data.sh "${SDK}"
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: quickstart_artifacts
path: quickstart-ios/
quickstart:
# Don't run on private repo unless it is a PR.
if: github.repository != 'FirebasePrivate/firebase-ios-sdk' || github.event_name == 'pull_request'
env:
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Setup quickstart
run: scripts/setup_quickstart.sh abtesting
- name: Install Secret GoogleService-Info.plist
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
- name: Install Secret FIREGSignInInfo.h
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/FIREGSignInInfo.h.gpg \
quickstart-ios/TestUtils/FIREGSignInInfo.h "$signin_secret"
- name: Test swift quickstart
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh ABTesting)
abtesting-cron-only:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository != 'FirebasePrivate/firebase-ios-sdk'
runs-on: macos-latest
strategy:
matrix:
target: [ios, tvos, macos]
flags: [
'--use-modular-headers',
'--use-libraries'
]
needs: pod-lib-lint
steps:
- uses: actions/checkout@v2
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: PodLibLint ABTesting Cron
run: |
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
FirebaseABTesting.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}