Skip to content

Commit 24fc333

Browse files
authored
Migrate Installations to GHA (#5692)
1 parent 8e3c0a7 commit 24fc333

File tree

3 files changed

+107
-74
lines changed

3 files changed

+107
-74
lines changed

.github/workflows/installations.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: installations
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
paths:
9+
- 'FirebaseInstallations**'
10+
- '.github/workflows/installations.yml'
11+
- 'Gemfile'
12+
schedule:
13+
# Run every day at 11pm (PST) - cron uses UTC times
14+
- cron: '0 7 * * *'
15+
16+
jobs:
17+
pod-lib-lint:
18+
runs-on: macOS-latest
19+
env:
20+
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
21+
strategy:
22+
matrix:
23+
target: [ios, tvos, macos]
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: Setup Bundler
27+
run: scripts/setup_bundler.sh
28+
- name: Install GoogleService-Info.plist
29+
run: |
30+
mkdir -p FirebaseInstallations/Source/Tests/Resources
31+
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Installations/GoogleService-Info.plist.gpg \
32+
FirebaseInstallations/Source/Tests/Resources/GoogleService-Info.plist "$plist_secret"
33+
- name: Get boolean for secrets available
34+
id: secrets
35+
run: echo "::set-output name=val::$([[ -z $plist_secret ]] && echo "0" || echo "1")"
36+
- name: Build and test
37+
run: |
38+
export FIS_INTEGRATION_TESTS_REQUIRED=${{ steps.secrets.outputs.val }}
39+
export FIS_ALLOWS_INCOMPATIBLE_IID_VERSION="1"
40+
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInstallations.podspec \
41+
--platforms=${{ matrix.target }} --ignore-local-podspecs=FirebaseInstanceID.podspec
42+
43+
# TODO - Catalyst is disabled because `pod gen` does not have a way to get some dependent pods
44+
# from a local path and the Installations podspec requires that FirebaseInstanceID.podspec not be
45+
# the local version.
46+
#
47+
# catalyst:
48+
# runs-on: macOS-latest
49+
# steps:
50+
# - uses: actions/checkout@v2
51+
# - name: Setup Bundler
52+
# run: scripts/setup_bundler.sh
53+
# - name: Setup project and Build for Catalyst
54+
# # Only build the unit tests on Catalyst. Test stopped working when GHA moved to Xcode 11.4.1.
55+
# run: scripts/test_catalyst.sh FirebaseInstallations build FirebaseInstallations-Unit-unit
56+
57+
quickstart:
58+
runs-on: macOS-latest
59+
steps:
60+
- uses: actions/checkout@v2
61+
- name: Setup quickstart
62+
run: scripts/setup_quickstart.sh installations
63+
- name: Copy mock plist
64+
run: cp quickstart-ios/mock-GoogleService-Info.plist quickstart-ios/installations/GoogleService-Info.plist
65+
- name: Test objc quickstart
66+
run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations
67+
- name: Test swift quickstart
68+
run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations swift
69+
70+
installations-cron-only:
71+
runs-on: macos-latest
72+
if: github.event_name == 'schedule'
73+
env:
74+
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
75+
FIR_IID_INTEGRATION_TESTS_REQUIRED: ${{ secrets.GHASecretsGPGPassphrase1 }}
76+
strategy:
77+
matrix:
78+
target: [ios, tvos, macos]
79+
flags: [
80+
'--use-modular-headers',
81+
'--use-libraries'
82+
]
83+
needs: pod-lib-lint
84+
steps:
85+
- uses: actions/checkout@v2
86+
- name: Setup Bundler
87+
run: scripts/setup_bundler.sh
88+
- name: Install GoogleService-Info.plist
89+
run: |
90+
mkdir -p FirebaseInstallations/Source/Tests/Resources
91+
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/Installations/GoogleService-Info.plist.gpg \
92+
FirebaseInstallations/Source/Tests/Resources/GoogleService-Info.plist "$plist_secret"
93+
- name: Get boolean for secrets available
94+
id: secrets
95+
run: echo "::set-output name=val::$([[ -z $plist_secret ]] && echo "0" || echo "1")"
96+
- name: PodLibLint Installations Cron
97+
run: |
98+
export FIS_INTEGRATION_TESTS_REQUIRED=${{ steps.secrets.outputs.val }}
99+
export FIS_ALLOWS_INCOMPATIBLE_IID_VERSION="1"
100+
FIR_IID_INTEGRATION_TESTS_REQUIRED="$plist_secret" scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
101+
FirebaseInstallations.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }} \
102+
--ignore-local-podspecs=FirebaseInstanceID.podspec

.travis.yml

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,6 @@ jobs:
114114
script:
115115
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseMessaging.podspec --platforms=ios
116116

117-
- stage: test
118-
if: type = cron
119-
env:
120-
- PROJECT=MessagingCron METHOD=pod-lib-lint
121-
script:
122-
# FirebaseMessaging includes Swift unit tests so it is not testable with --use-libraries.
123-
# TODO(paulb777): Migrate FirebaseMessaging to pod gen driven tests with a separate test
124-
# target for Swift.
125-
- travis_retry ./scripts/pod_lib_lint.rb FirebaseMessaging.podspec --platforms=ios --use-libraries --skip-tests
126-
- travis_retry ./scripts/pod_lib_lint.rb FirebaseMessaging.podspec --platforms=tvos --use-libraries --skip-tests
127-
- travis_retry ./scripts/pod_lib_lint.rb FirebaseMessaging.podspec --platforms=macos --use-libraries --skip-tests
128-
- travis_retry ./scripts/pod_lib_lint.rb FirebaseMessaging.podspec --platforms=ios --use-modular-headers
129-
- travis_retry ./scripts/pod_lib_lint.rb FirebaseMessaging.podspec --platforms=tvos --use-modular-headers
130-
- travis_retry ./scripts/pod_lib_lint.rb FirebaseMessaging.podspec --platforms=macos --use-modular-headers
131-
132117
- stage: test
133118
osx_image: xcode10.3
134119
env:
@@ -322,45 +307,6 @@ jobs:
322307
script:
323308
- travis_retry ./CocoapodsIntegrationTest/scripts/build_with_environment.sh --gemfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Gemfile --podfile=./CocoapodsIntegrationTest/TestEnvironments/${POD_CONFIG_DIR}/Podfile
324309

325-
# FIS
326-
- stage: test
327-
env:
328-
- PROJECT=Installations PLATFORM=iOS METHOD=pod-lib-lint
329-
- FIS_ALLOWS_INCOMPATIBLE_IID_VERSION=1
330-
- FIS_INTEGRATION_TESTS_REQUIRED=$(if [[ "$TRAVIS_PULL_REQUEST" == "false" || "$TRAVIS_PULL_REQUEST_SLUG" == "$TRAVIS_REPO_SLUG" ]]; then echo "1"; else echo "0"; fi)
331-
- QUICKSTART=Installations
332-
before_install:
333-
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
334-
script:
335-
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseInstallations.podspec --platforms=ios --ignore-local-podspecs=FirebaseInstanceID.podspec
336-
- travis_retry ./scripts/if_changed.sh ./scripts/test_quickstart.sh Installations
337-
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseInstallations.podspec --platforms=ios --use-libraries --ignore-local-podspecs=FirebaseInstanceID.podspec
338-
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseInstallations.podspec --use-modular-headers --platforms=ios --ignore-local-podspecs=FirebaseInstanceID.podspec
339-
340-
- stage: test
341-
env:
342-
- PROJECT=Installations PLATFORM=macOS METHOD=pod-lib-lint
343-
- FIS_ALLOWS_INCOMPATIBLE_IID_VERSION=1
344-
- FIS_INTEGRATION_TESTS_REQUIRED=$(if [[ "$TRAVIS_PULL_REQUEST" == "false" || "$TRAVIS_PULL_REQUEST_SLUG" == "$TRAVIS_REPO_SLUG" ]]; then echo "1"; else echo "0"; fi)
345-
before_install:
346-
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
347-
script:
348-
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseInstallations.podspec --platforms=macos --ignore-local-podspecs=FirebaseInstanceID.podspec
349-
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseInstallations.podspec --platforms=macos --use-libraries --ignore-local-podspecs=FirebaseInstanceID.podspec
350-
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseInstallations.podspec --use-modular-headers --platforms=macos --ignore-local-podspecs=FirebaseInstanceID.podspec
351-
352-
- stage: test
353-
env:
354-
- PROJECT=Installations PLATFORM=tvOS METHOD=pod-lib-lint
355-
- FIS_ALLOWS_INCOMPATIBLE_IID_VERSION=1
356-
- FIS_INTEGRATION_TESTS_REQUIRED=$(if [[ "$TRAVIS_PULL_REQUEST" == "false" || "$TRAVIS_PULL_REQUEST_SLUG" == "$TRAVIS_REPO_SLUG" ]]; then echo "1"; else echo "0"; fi)
357-
before_install:
358-
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
359-
script:
360-
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseInstallations.podspec --platforms=tvos --ignore-local-podspecs=FirebaseInstanceID.podspec
361-
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseInstallations.podspec --platforms=tvos --use-libraries --ignore-local-podspecs=FirebaseInstanceID.podspec
362-
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseInstallations.podspec --use-modular-headers --platforms=tvos --ignore-local-podspecs=FirebaseInstanceID.podspec
363-
364310
allow_failures:
365311
# Run fuzz tests only on cron jobs.
366312
- stage: test

scripts/setup_quickstart.sh

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ $scripts_dir/setup_bundler.sh
2626
# Source function to check if CI secrets are available.
2727
source $scripts_dir/check_secrets.sh
2828

29-
if check_secrets; then
30-
SAMPLE=$1
29+
SAMPLE=$1
30+
31+
# Installations is the only quickstart that doesn't need a real
32+
# GoogleService-Info.plist for its tests.
33+
if check_secrets || [[ ${SAMPLE} == "installations" ]]; then
3134

3235
# Specify repo so the Firebase module and header can be found in a
3336
# development pod install. This is needed for the `pod install` command.
@@ -46,23 +49,5 @@ if check_secrets; then
4649

4750
# Add GoogleService-Info.plist to Xcode project
4851
ruby ../scripts/info_script.rb "${SAMPLE}"
49-
50-
# Secrets are repo specific, so we need to override with the firebase-ios-sdk
51-
# version. GHA manages the secrets in its action script.
52-
PLIST_FILE=$root_dir/Secrets/quickstart-ios/"$SAMPLE"/GoogleService-Info.plist
53-
if [[ -n "${TRAVIS_PULL_REQUEST:-}" ]]; then
54-
if [[ -f "$PLIST_FILE" ]]; then
55-
cp $root_dir/Secrets/quickstart-ios/"$SAMPLE"/GoogleService-Info.plist ./
56-
cp $root_dir/Secrets/quickstart-ios/TestUtils/FIREGSignInInfo.h ../TestUtils/
57-
if [[ ${SAMPLE} == "DynamicLinks" ]]; then
58-
sed -i '' 's#DYNAMIC_LINK_DOMAIN#https://qpf6m.app.goo.gl#' DynamicLinksExample/DynamicLinksExample.entitlements
59-
sed -i '' 's#YOUR_DOMAIN_URI_PREFIX";#https://qpf6m.app.goo.gl";#' DynamicLinksExample/ViewController.m
60-
elif [[ ${SAMPLE} == "Functions" ]]; then
61-
sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' FunctionsExample/Info.plist
62-
fi
63-
else
64-
cp ../mock-GoogleService-Info.plist ./GoogleService-Info.plist
65-
fi
66-
fi
6752
cd -
6853
fi

0 commit comments

Comments
 (0)