Skip to content

Commit 900e7ed

Browse files
authored
Run remoteconfig framework testing. (#5741)
* Run remoteconfig framework testing. This testing is scheduled at 3am PST, 3 hours after zip testing triggered. This is to enable the zip testing to test the latest built zip file.
1 parent 8d4c0f4 commit 900e7ed

File tree

4 files changed

+140
-2
lines changed

4 files changed

+140
-2
lines changed

.github/workflows/remoteconfig.yml

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ on:
1111
- '.github/workflows/remoteconfig.yml'
1212
- 'Gemfile'
1313
schedule:
14-
# Run every day at 11pm (PST) - cron uses UTC times
15-
- cron: '0 7 * * *'
14+
# Run every day at 3am (PST) - cron uses UTC times
15+
# This is set to 3 hours after zip workflow so zip testing can run after.
16+
- cron: '0 11 * * *'
1617

1718
jobs:
1819

@@ -62,6 +63,60 @@ jobs:
6263
# Only build the unit tests on Catalyst. Test stopped working when GHA moved to Xcode 11.4.1.
6364
run: scripts/test_catalyst.sh FirebaseRemoteConfig build FirebaseRemoteConfig-Unit-unit
6465

66+
quickstart_framework:
67+
env:
68+
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
69+
signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
70+
FRAMEWORK_ZIP: "Firebase-actions-dir.zip"
71+
SDK: "Config"
72+
runs-on: macOS-latest
73+
# Make sure tests run after the zip workflow finishes.
74+
if: github.event_name == 'schedule'
75+
steps:
76+
- uses: actions/checkout@v2
77+
- name: Install gcloud tool
78+
run: scripts/install_gcloud.sh
79+
- name: Access GCS bucket
80+
run: |
81+
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/firebase-ios-testing.json.gpg firebase-ios-testing.json "$plist_secret"
82+
gcloud auth activate-service-account --key-file firebase-ios-testing.json
83+
- name: Pull framework zip files from GCS and unzip
84+
run: scripts/get_latest_zip_from_gcs.sh "$FRAMEWORK_ZIP" "${HOME}/ios_frameworks"
85+
- name: Setup quickstart
86+
run: scripts/setup_quickstart_framework.sh "$SDK"
87+
- name: Move frameworks to xcode project
88+
run: |
89+
mkdir -p quickstart-ios/"${SDK}"/Firebase/
90+
mv "${HOME}"/ios_frameworks/Firebase/Firebase.h quickstart-ios/"${SDK}"/Firebase/
91+
mv "${HOME}"/ios_frameworks/Firebase/module.modulemap quickstart-ios/"${SDK}"/Firebase/
92+
mv "${HOME}"/ios_frameworks/Firebase/FirebaseRemoteConfig/* quickstart-ios/"${SDK}"/Firebase/
93+
mv "${HOME}"/ios_frameworks/Firebase/FirebaseAnalytics/* quickstart-ios/"${SDK}"/Firebase/
94+
cd quickstart-ios/"${SDK}"
95+
../scripts/add_framework_script.rb "${SDK}" ConfigExample Firebase
96+
- name: Install Secret GoogleService-Info.plist
97+
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-config.plist.gpg \
98+
quickstart-ios/config/GoogleService-Info.plist "$plist_secret"
99+
- name: Install Secret FIREGSignInInfo.h
100+
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/FIREGSignInInfo.h.gpg \
101+
quickstart-ios/TestUtils/FIREGSignInInfo.h "$signin_secret"
102+
- name: Test Quickstart
103+
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_framework.sh "${SDK}")
104+
- name: Display xcodebuild setup
105+
if: ${{ failure() }}
106+
run: |
107+
cd quickstart-ios/config
108+
xcodebuild -project ConfigExample.xcodeproj -target "ConfigExample" -showBuildSettings
109+
- name: Remove data before upload
110+
if: ${{ failure() }}
111+
run: |
112+
rm -f quickstart-ios/config/GoogleSerivce-info.plist
113+
rm -f quickstart-ios/TestUtils/FIREGSignInInfo.h
114+
- uses: actions/upload-artifact@v2
115+
if: ${{ failure() }}
116+
with:
117+
name: quickstart_artifacts
118+
path: quickstart-ios/
119+
65120
quickstart:
66121
env:
67122
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}

scripts/get_latest_zip_from_gcs.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
# Copyright 2020 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -x
18+
19+
FRAMEWORK_ZIP="$1"
20+
OUTPUT_DIR="$2"
21+
22+
gsutil cp "gs://ios-framework-zip/latest_commit_hash.txt" latest_commit_hash.txt
23+
commit_hash="$(cat 'latest_commit_hash.txt')"
24+
gsutil cp "gs://ios-framework-zip/Firebase-actions-dir-${commit_hash}.zip" "${FRAMEWORK_ZIP}"
25+
mkdir "${OUTPUT_DIR}"
26+
unzip "${FRAMEWORK_ZIP}" -d "${OUTPUT_DIR}"
27+
find "${OUTPUT_DIR}" -name "*.zip" -maxdepth 3 -exec unzip -d "${OUTPUT_DIR}" {} +

scripts/setup_quickstart_framework.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
SAMPLE="$1"
16+
git clone https://github.com/firebase/quickstart-ios.git
17+
cd quickstart-ios/"${SAMPLE}"
18+
chmod +x ../scripts/info_script.rb
19+
ruby ../scripts/info_script.rb "${SAMPLE}"

scripts/test_quickstart_framework.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
# Copyright 2020 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
18+
# Run a CI `script` phase to build the associated quickstart
19+
# sample and run its tests.
20+
21+
set -xeuo pipefail
22+
23+
sample="$1"
24+
platform="${2-}"
25+
26+
# Source function to check if CI secrets are available.
27+
source scripts/check_secrets.sh
28+
29+
if check_secrets; then
30+
cd quickstart-ios
31+
if [ "$platform" = "swift" ]; then
32+
have_secrets=true SAMPLE="$sample" SWIFT_SUFFIX="Swift" scripts/framework_test.sh
33+
else
34+
have_secrets=true SAMPLE="$sample" scripts/framework_test.sh
35+
fi
36+
37+
fi

0 commit comments

Comments
 (0)