Skip to content

Commit a511c1b

Browse files
Merge
2 parents 0b200d3 + f139608 commit a511c1b

39 files changed

+272
-95
lines changed

.github/workflows/cpp-packaging.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ jobs:
142142
name: packaging-tools-${{ matrix.tools_platform }}
143143
path: packaging-tools.tgz
144144

145-
build_and_package_ios:
146-
name: build-and-package-ios
145+
build_and_package_ios_tvos:
146+
name: build-and-package-ios-tvos
147147
runs-on: macos-latest
148148
if: ${{ github.event.inputs.downloadPublicVersion == '' && github.event.inputs.downloadPreviousRun == '' }}
149149
steps:
@@ -156,15 +156,21 @@ jobs:
156156
with:
157157
path: sdk-src
158158

159+
- name: Setup python
160+
uses: actions/setup-python@v2
161+
with:
162+
python-version: 3.7
163+
159164
- name: install prerequisites
160165
run: sdk-src/build_scripts/ios/install_prereqs.sh
161166

162167
- name: build sdk
163168
run: |
164-
sdk-src/build_scripts/ios/build.sh -b firebase-cpp-sdk-ios-build -s sdk-src
165-
sdk-src/build_scripts/ios/package.sh firebase-cpp-sdk-ios-build firebase-cpp-sdk-ios-package
166-
cd firebase-cpp-sdk-ios-package
167-
tar -czhf ../firebase-cpp-sdk-ios-package.tgz .
169+
python sdk-src/scripts/gha/build_ios_tvos.py -b firebase-cpp-sdk-ios-tvos-build -s sdk-src
170+
sdk-src/build_scripts/ios/package.sh firebase-cpp-sdk-ios-tvos-build firebase-cpp-sdk-ios-tvos-package
171+
sdk-src/build_scripts/tvos/package.sh firebase-cpp-sdk-ios-tvos-build firebase-cpp-sdk-ios-tvos-package
172+
cd firebase-cpp-sdk-ios-tvos-package
173+
tar -czhf ../firebase-cpp-sdk-ios-tvos-package.tgz .
168174
169175
- name: Print built libraries
170176
shell: bash
@@ -184,8 +190,8 @@ jobs:
184190
- name: upload artifacts
185191
uses: actions/[email protected]
186192
with:
187-
name: firebase-cpp-sdk-ios-package
188-
path: firebase-cpp-sdk-ios-package.tgz
193+
name: firebase-cpp-sdk-ios-tvos-package
194+
path: firebase-cpp-sdk-ios-tvos-package.tgz
189195

190196
build_and_package_android:
191197
name: build-and-package-android-${{matrix.stl}}
@@ -600,7 +606,7 @@ jobs:
600606
name: final-merge-packages
601607
runs-on: ubuntu-latest
602608
if: ${{ github.event.inputs.downloadPublicVersion == '' && github.event.inputs.downloadPreviousRun == '' }}
603-
needs: [build_and_package_ios, build_and_package_android, package_desktop, log_inputs]
609+
needs: [build_and_package_ios_tvos, build_and_package_android, package_desktop, log_inputs]
604610
steps:
605611
- name: fetch SDK
606612
uses: actions/[email protected]
@@ -714,9 +720,13 @@ jobs:
714720
if [[ -z ${USE_EXPANDED_MATRIX} ]]; then
715721
USE_EXPANDED_MATRIX=0
716722
fi
723+
if [[ "${{ github.event_name }}" == "schedule" ]]; then
724+
# reuse flag --test_pull_request=sdk to generate report
725+
generate_report=(-p test_pull_request sdk)
726+
fi
717727
verbose_flag=
718728
if [[ -n "${{ github.event.inputs.verboseBuild }}" && "${{ github.event.inputs.verboseBuild }}" -ne 0 ]]; then
719729
verbose_flag=-v
720730
fi
721731
set -e
722-
python scripts/gha/trigger_workflow.py -t ${{ steps.generate-token.outputs.token }} -w integration_tests.yml -p test_packaged_sdk ${{ github.run_id }} -p use_expanded_matrix ${USE_EXPANDED_MATRIX} -s 10 -A ${verbose_flag}
732+
python scripts/gha/trigger_workflow.py -t ${{ steps.generate-token.outputs.token }} -w integration_tests.yml -p test_packaged_sdk ${{ github.run_id }} -p use_expanded_matrix ${USE_EXPANDED_MATRIX} ${generate_report[*]} -s 10 -A ${verbose_flag}

.github/workflows/integration_tests.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
### subsequent steps to update the labels as well.
5959
runs-on: ubuntu-latest
6060
if: |
61-
github.event_name == 'pull_request' || github.event.inputs.test_pull_request != ''
61+
github.event_name == 'pull_request' || (github.event.inputs.test_pull_request != '' && github.event.inputs.test_pull_request != 'sdk')
6262
outputs:
6363
should_update_pr: ${{ steps.set_outputs.outputs.should_update_pr }}
6464
requested_tests: ${{ steps.set_outputs.outputs.requested_tests }}
@@ -166,7 +166,7 @@ jobs:
166166
if: needs.check_trigger.outputs.requested_tests == 'auto'
167167
run: |
168168
echo "Autodetecting which tests to run."
169-
if [[ -n "${{github.event.inputs.test_pull_request}}" ]]; then
169+
if [[ -n "${{github.event.inputs.test_pull_request}}" || "${{github.event.inputs.test_pull_request}}" == "sdk" ]]; then
170170
# If running this manually, diff against our common ancestor with main.
171171
MERGE_BASE=$(git merge-base HEAD origin/main)
172172
echo "::warning ::Auto-diff HEAD..${MERGE_BASE}"
@@ -203,7 +203,7 @@ jobs:
203203
echo "::set-output name=android_device::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${EXPANDED_MATRIX_PARAM} -k android_device -t ${mobile_test_on} )"
204204
echo "::set-output name=ios_device::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${EXPANDED_MATRIX_PARAM} -k ios_device -t ${mobile_test_on} )"
205205
echo "::set-output name=tvos_device::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${EXPANDED_MATRIX_PARAM} -k tvos_device -t ${mobile_test_on} )"
206-
if [[ -z "${{github.event.inputs.test_pull_request}}" ]]; then
206+
if [[ -z "${{github.event.inputs.test_pull_request}}" || "${{github.event.inputs.test_pull_request}}" == "sdk" ]]; then
207207
echo "::warning ::Running on https://github.com/${{github.repository}}/commits/$GITHUB_SHA"
208208
echo "::set-output name=github_ref::$GITHUB_SHA"
209209
elif [[ "${{github.event.inputs.test_pull_request}}" == *:* ]]; then
@@ -750,7 +750,7 @@ jobs:
750750
shell: bash
751751
run: |
752752
if [ ! -f testapps/test-results-desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}.log.json ]; then
753-
echo "__SUMMARY_MISSING__" > testapps/test-results-desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}.log.json
753+
mkdir -p testapps && echo "__SUMMARY_MISSING__" > testapps/test-results-desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}.log.json
754754
fi
755755
- name: Upload Desktop test results artifact
756756
if: ${{ !cancelled() }}
@@ -836,7 +836,7 @@ jobs:
836836
shell: bash
837837
run: |
838838
if [ ! -f "testapps/test-results-android-${{ matrix.build_os }}-${{ matrix.android_device }}.log.json" ]; then
839-
echo "__SUMMARY_MISSING__" > "testapps/test-results-android-${{ matrix.build_os }}-${{ matrix.android_device }}.log.json"
839+
mkdir -p testapps && echo "__SUMMARY_MISSING__" > "testapps/test-results-android-${{ matrix.build_os }}-${{ matrix.android_device }}.log.json"
840840
fi
841841
- name: Upload Android test results artifact
842842
if: ${{ !cancelled() }}
@@ -921,7 +921,7 @@ jobs:
921921
shell: bash
922922
run: |
923923
if [ ! -f "testapps/test-results-ios-macos-latest-${{ matrix.ios_device }}.log.json" ]; then
924-
echo "__SUMMARY_MISSING__" > "testapps/test-results-ios-macos-latest-${{ matrix.ios_device }}.log.json"
924+
mkdir -p testapps && echo "__SUMMARY_MISSING__" > "testapps/test-results-ios-macos-latest-${{ matrix.ios_device }}.log.json"
925925
fi
926926
- name: Upload iOS test results artifact
927927
if: ${{ !cancelled() }}
@@ -990,7 +990,7 @@ jobs:
990990
shell: bash
991991
run: |
992992
if [ ! -f "testapps/test-results-tvos-macos-latest-${{ matrix.tvos_device }}.log.json" ]; then
993-
echo "__SUMMARY_MISSING__" > "testapps/test-results-tvos-macos-latest-${{ matrix.tvos_device }}.log.json"
993+
mkdir -p testapps && echo "__SUMMARY_MISSING__" > "testapps/test-results-tvos-macos-latest-${{ matrix.tvos_device }}.log.json"
994994
fi
995995
- name: Upload tvOS test results artifact
996996
if: ${{ !cancelled() }}
@@ -1062,12 +1062,19 @@ jobs:
10621062
--run_id ${{github.run_id}} \
10631063
--new_token ${{steps.generate-token.outputs.token}}
10641064
- name: Update Daily Report
1065-
if: ${{ github.event_name == 'schedule' }}
1065+
if: ${{ github.event_name == 'schedule' || github.event.inputs.test_pull_request == 'sdk'}}
1066+
shell: bash
10661067
run: |
1068+
if [[ "${{ github.event.inputs.test_pull_request }}" == "sdk" ]]; then
1069+
additional_flags=(--build_against sdk)
1070+
else
1071+
additional_flags=(--build_against repo)
1072+
fi
10671073
python scripts/gha/it_workflow.py --stage report \
10681074
--token ${{github.token}} \
10691075
--actor ${{github.actor}} \
10701076
--commit ${{needs.prepare_matrix.outputs.github_ref}} \
1071-
--run_id ${{github.run_id}}
1077+
--run_id ${{github.run_id}} \
1078+
${additional_flags[*]}
10721079
- name: Summarize results into GitHub log
10731080
run: python scripts/gha/summarize_test_results.py --dir test_results --github_log

Android/firebase_dependencies.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ def firebaseDependenciesMap = [
2323
'analytics' : ['com.google.firebase:firebase-analytics:19.0.0',
2424
'com.google.android.gms:play-services-base:17.6.0'],
2525
'auth' : ['com.google.firebase:firebase-auth:21.0.1'],
26-
'database' : ['com.google.firebase:firebase-database:20.0.0'],
27-
'dynamic_links' : ['com.google.firebase:firebase-dynamic-links:20.1.0'],
28-
'firestore' : ['com.google.firebase:firebase-firestore:23.0.2'],
26+
'database' : ['com.google.firebase:firebase-database:20.0.1'],
27+
'dynamic_links' : ['com.google.firebase:firebase-dynamic-links:20.1.1'],
28+
'firestore' : ['com.google.firebase:firebase-firestore:23.0.3'],
2929
'functions' : ['com.google.firebase:firebase-functions:20.0.0'],
3030
'installations' : ['com.google.firebase:firebase-installations:17.0.0',
3131
'com.google.android.gms:play-services-base:17.6.0'],

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ if(FIREBASE_CPP_BUILD_TESTS OR FIREBASE_CPP_BUILD_STUB_TESTS)
118118
endif()
119119

120120
if (PLATFORM STREQUAL TVOS OR PLATFORM STREQUAL SIMULATOR_TVOS)
121-
# AdMob, FDL are not supported on tvOS.
121+
# Analytics, AdMob, FDL are not supported on tvOS.
122122
set(FIREBASE_INCLUDE_ADMOB OFF)
123+
set(FIREBASE_INCLUDE_ANALYTICS OFF)
123124
set(FIREBASE_INCLUDE_DYNAMIC_LINKS OFF)
124125
endif()
125126

app/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,9 @@ set_property(TARGET firebase_app PROPERTY FOLDER "Firebase Cpp")
328328

329329
# Disable exceptions in std
330330
if (MSVC)
331-
target_compile_options(firebase_app PUBLIC /EHs-c-)
331+
target_compile_options(firebase_app PRIVATE /EHs-c-)
332332
else()
333-
target_compile_options(firebase_app PUBLIC -fno-exceptions)
333+
target_compile_options(firebase_app PRIVATE -fno-exceptions)
334334
endif()
335335

336336
target_include_directories(firebase_app

app/invites_resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ android {
5050

5151
dependencies {
5252
implementation 'com.google.firebase:firebase-analytics:19.0.0'
53-
implementation 'com.google.firebase:firebase-dynamic-links:20.1.0'
53+
implementation 'com.google.firebase:firebase-dynamic-links:20.1.1'
5454
implementation project(':app:app_resources')
5555
}
5656

app/tests/thread_test.cc

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
#include "gmock/gmock.h"
2121
#include "gtest/gtest.h"
2222

23+
#define EXPECT_THROW_ERROR_CODE(statement, error_code) \
24+
EXPECT_THROW( \
25+
{ \
26+
try { \
27+
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
28+
} catch (const std::system_error& exception) { \
29+
EXPECT_EQ(error_code, exception.code()); \
30+
throw; \
31+
} \
32+
}, \
33+
std::system_error)
34+
2335
namespace {
2436

2537
using ::testing::Eq;
@@ -107,66 +119,66 @@ TEST(ThreadDeathTest, MovingIntoRunningThreadShouldAbort) {
107119
}
108120

109121
TEST(ThreadDeathTest, JoinEmptyThreadShouldAbort) {
110-
ASSERT_DEATH(
122+
EXPECT_THROW_ERROR_CODE(
111123
{
112124
firebase::Thread thread;
113125
thread.Join();
114126
},
115-
"");
127+
std::errc::invalid_argument);
116128
}
117129

118130
TEST(ThreadDeathTest, JoinThreadMultipleTimesShouldAbort) {
119-
ASSERT_DEATH(
131+
EXPECT_THROW_ERROR_CODE(
120132
{
121133
firebase::Thread thread([] {});
122134

123135
thread.Join();
124136
thread.Join();
125137
},
126-
"");
138+
std::errc::invalid_argument);
127139
}
128140

129141
TEST(ThreadDeathTest, JoinDetachedThreadShouldAbort) {
130-
ASSERT_DEATH(
142+
EXPECT_THROW_ERROR_CODE(
131143
{
132144
firebase::Thread thread([] {});
133145

134146
thread.Detach();
135147
thread.Join();
136148
},
137-
"");
149+
std::errc::invalid_argument);
138150
}
139151

140152
TEST(ThreadDeathTest, DetachJoinedThreadShouldAbort) {
141-
ASSERT_DEATH(
153+
EXPECT_THROW_ERROR_CODE(
142154
{
143155
firebase::Thread thread([] {});
144156

145157
thread.Join();
146158
thread.Detach();
147159
},
148-
"");
160+
std::errc::invalid_argument);
149161
}
150162

151163
TEST(ThreadDeathTest, DetachEmptyThreadShouldAbort) {
152-
ASSERT_DEATH(
164+
EXPECT_THROW_ERROR_CODE(
153165
{
154166
firebase::Thread thread;
155167

156168
thread.Detach();
157169
},
158-
"");
170+
std::errc::invalid_argument);
159171
}
160172

161173
TEST(ThreadDeathTest, DetachThreadMultipleTimesShouldAbort) {
162-
ASSERT_DEATH(
174+
EXPECT_THROW_ERROR_CODE(
163175
{
164176
firebase::Thread thread([] {});
165177

166178
thread.Detach();
167179
thread.Detach();
168180
},
169-
"");
181+
std::errc::invalid_argument);
170182
}
171183

172184
TEST(ThreadDeathTest, WhenJoinableThreadIsDestructedShouldAbort) {

database/database_resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ android {
4646

4747
dependencies {
4848
implementation 'com.google.firebase:firebase-analytics:19.0.0'
49-
implementation 'com.google.firebase:firebase-database:20.0.0'
49+
implementation 'com.google.firebase:firebase-database:20.0.1'
5050
//implementation project(':app:app_resources')
5151
}
5252

firestore/firestore_resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ android {
5454

5555
dependencies {
5656
implementation 'com.google.firebase:firebase-analytics:19.0.0'
57-
implementation 'com.google.firebase:firebase-firestore:23.0.2'
57+
implementation 'com.google.firebase:firebase-firestore:23.0.3'
5858
}
5959

6060
afterEvaluate {

firestore/src/main/collection_reference_main.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include "firestore/src/main/promise_factory_main.h"
1111
#include "firestore/src/main/query_main.h"
1212

13+
#if defined(__ANDROID__)
14+
#error "This header should not be used on Android."
15+
#endif
16+
1317
namespace firebase {
1418
namespace firestore {
1519

0 commit comments

Comments
 (0)