Skip to content

Commit f5809d0

Browse files
authored
Merge branch 'main' into fix/unbuffered-io-violation-android-14
2 parents 37aecfd + 0554f0d commit f5809d0

File tree

495 files changed

+16879
-7734
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

495 files changed

+16879
-7734
lines changed

.github/workflows/ci_tests.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,9 @@ jobs:
5656
distribution: temurin
5757
cache: gradle
5858

59-
- name: Pull genai-common
60-
if: matrix.module == ':firebase-vertexai'
61-
run: |
62-
git clone https://github.com/google-gemini/generative-ai-android.git
63-
cd generative-ai-android
64-
./gradlew :common:updateVersion common:publishToMavenLocal
65-
cd ..
66-
6759
- name: Clone mock responses
6860
if: matrix.module == ':firebase-vertexai'
69-
run: |
70-
firebase-vertexai/update_responses.sh
61+
run: firebase-vertexai/update_responses.sh
7162

7263
- name: Add google-services.json
7364
env:
@@ -119,6 +110,7 @@ jobs:
119110
module: ${{ fromJSON(needs.determine_changed.outputs.modules) }}
120111
exclude:
121112
- module: :firebase-firestore
113+
- module: :firebase-functions:ktx
122114

123115
steps:
124116
- uses: actions/[email protected]

.github/workflows/create_releases.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
jobs:
1616
create-branches:
1717
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
pull-requests: write
1821
env:
1922
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2023
steps:
@@ -25,6 +28,9 @@ jobs:
2528

2629
create-pull-request:
2730
runs-on: ubuntu-latest
31+
permissions:
32+
contents: write
33+
pull-requests: write
2834
steps:
2935
- uses: actions/[email protected]
3036
with:
@@ -40,7 +46,7 @@ jobs:
4046
./gradlew generateReleaseConfig -PcurrentRelease=${{ inputs.name }} -PpastRelease=${{ inputs.past-name }} -PprintOutput=true
4147
4248
- name: Create Pull Request
43-
uses: peter-evans/create-pull-request@v4
49+
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f
4450
with:
4551
base: 'releases/${{ inputs.name }}'
4652
branch: 'releases/${{ inputs.name }}.release'

.github/workflows/dataconnect.yml

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
name: Data Connect Integration Tests
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
javaVersion:
7+
androidEmulatorApiLevel:
8+
nodeJsVersion:
9+
firebaseToolsVersion:
10+
gradleInfoLog:
11+
type: boolean
12+
pull_request:
13+
paths:
14+
- .github/workflows/dataconnect.yml
15+
- 'firebase-dataconnect/**'
16+
- '!firebase-dataconnect/demo/**'
17+
- '!firebase-dataconnect/scripts/**'
18+
- '!firebase-dataconnect/**/*.md'
19+
- '!firebase-dataconnect/**/*.txt'
20+
schedule:
21+
- cron: '0 11 * * *' # Run nightly at 11am UTC (3am Pacific, 6am Eastern)
22+
23+
env:
24+
FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }}
25+
FDC_ANDROID_EMULATOR_API_LEVEL: ${{ inputs.androidEmulatorApiLevel || '34' }}
26+
FDC_NODEJS_VERSION: ${{ inputs.nodeJsVersion || '20' }}
27+
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '13.29.1' }}
28+
FDC_FIREBASE_TOOLS_DIR: /tmp/firebase-tools
29+
FDC_FIREBASE_COMMAND: /tmp/firebase-tools/node_modules/.bin/firebase
30+
31+
concurrency:
32+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
33+
cancel-in-progress: true
34+
35+
jobs:
36+
integration-test:
37+
continue-on-error: false
38+
runs-on: ubuntu-latest
39+
40+
services:
41+
postgres:
42+
image: postgres
43+
env:
44+
POSTGRES_PASSWORD: password
45+
options: >-
46+
--health-cmd pg_isready
47+
--health-interval 10s
48+
--health-timeout 5s
49+
--health-retries 5
50+
ports:
51+
- 5432:5432
52+
53+
steps:
54+
- uses: actions/checkout@v4
55+
with:
56+
show-progress: false
57+
58+
- uses: actions/setup-java@v4
59+
with:
60+
java-version: ${{ env.FDC_JAVA_VERSION }}
61+
distribution: temurin
62+
63+
- uses: actions/setup-node@v4
64+
with:
65+
node-version: ${{ env.FDC_NODEJS_VERSION }}
66+
67+
- name: install firebase-tools
68+
run: |
69+
set -v
70+
mkdir -p ${{ env.FDC_FIREBASE_TOOLS_DIR }}
71+
cd ${{ env.FDC_FIREBASE_TOOLS_DIR }}
72+
echo '{}' > package.json
73+
npm install --fund=false --audit=false --save --save-exact firebase-tools@${{ env.FDC_FIREBASE_TOOLS_VERSION }}
74+
75+
- name: Restore Gradle cache
76+
id: restore-gradle-cache
77+
uses: actions/cache/restore@v4
78+
if: github.event_name != 'schedule'
79+
with:
80+
path: |
81+
~/.gradle/caches
82+
~/.gradle/wrapper
83+
key: gradle-cache-jqnvfzw6w7-${{ github.run_id }}
84+
restore-keys: |
85+
gradle-cache-jqnvfzw6w7-
86+
87+
- name: tool versions
88+
continue-on-error: true
89+
run: |
90+
function run_cmd {
91+
echo "==============================================================================="
92+
echo "Running Command: $*"
93+
("$@" 2>&1) || echo "WARNING: command failed with non-zero exit code $?: $*"
94+
}
95+
96+
run_cmd uname -a
97+
run_cmd which java
98+
run_cmd java -version
99+
run_cmd which javac
100+
run_cmd javac -version
101+
run_cmd which node
102+
run_cmd node --version
103+
run_cmd ${{ env.FDC_FIREBASE_COMMAND }} --version
104+
run_cmd ./gradlew --version
105+
106+
- name: Gradle assembleDebugAndroidTest
107+
run: |
108+
set -v
109+
110+
# Speed up build times and also avoid configuring firebase-crashlytics-ndk
111+
# which is finicky integrating with the Android NDK.
112+
echo >> gradle.properties
113+
echo "org.gradle.configureondemand=true" >> gradle.properties
114+
115+
./gradlew \
116+
--profile \
117+
${{ (inputs.gradleInfoLog && '--info') || '' }} \
118+
:firebase-dataconnect:assembleDebugAndroidTest
119+
120+
- name: Save Gradle cache
121+
uses: actions/cache/save@v4
122+
if: github.event_name == 'schedule'
123+
with:
124+
path: |
125+
~/.gradle/caches
126+
~/.gradle/wrapper
127+
key: ${{ steps.restore-gradle-cache.outputs.cache-primary-key }}
128+
129+
- name: Enable KVM group permissions for Android Emulator
130+
run: |
131+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
132+
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
133+
sudo udevadm control --reload-rules
134+
sudo udevadm trigger --name-match=kvm
135+
136+
- name: Restore AVD cache
137+
uses: actions/cache/restore@v4
138+
if: github.event_name != 'schedule'
139+
id: restore-avd-cache
140+
with:
141+
path: |
142+
~/.android/avd/*
143+
~/.android/adb*
144+
key: avd-cache-zhdsn586je-api${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}-${{ github.run_id }}
145+
restore-keys: |
146+
avd-cache-zhdsn586je-api${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}-
147+
148+
- name: Create AVD
149+
if: github.event_name == 'schedule' || steps.restore-avd-cache.outputs.cache-hit != 'true'
150+
uses: reactivecircus/android-emulator-runner@v2
151+
with:
152+
api-level: ${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}
153+
arch: x86_64
154+
force-avd-creation: false
155+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
156+
disable-animations: true
157+
script: echo "Generated AVD snapshot for caching."
158+
159+
- name: Save AVD cache
160+
uses: actions/cache/save@v4
161+
if: github.event_name == 'schedule'
162+
with:
163+
path: |
164+
~/.android/avd/*
165+
~/.android/adb*
166+
key: ${{ steps.restore-avd-cache.outputs.cache-primary-key }}
167+
168+
- name: Data Connect Emulator
169+
run: |
170+
set -x
171+
172+
echo 'emulator.postgresConnectionUrl=postgresql://postgres:[email protected]:5432?sslmode=disable' > firebase-dataconnect/dataconnect.local.properties
173+
174+
./gradlew \
175+
${{ (inputs.gradleInfoLog && '--info') || '' }} \
176+
:firebase-dataconnect:connectors:runDebugDataConnectEmulator \
177+
>firebase.emulator.dataconnect.log 2>&1 &
178+
179+
- name: Firebase Auth Emulator
180+
run: |
181+
set -x
182+
cd firebase-dataconnect/emulator
183+
${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth >firebase.emulator.auth.log 2>&1 &
184+
185+
- name: Capture Logcat Logs
186+
run: adb logcat >logcat.log &
187+
188+
- name: Gradle connectedCheck
189+
id: connectedCheck
190+
uses: reactivecircus/android-emulator-runner@v2
191+
# Allow this GitHub Actions "job" to continue even if the tests fail so that logs from a
192+
# failed test run get uploaded as "artifacts" and are available to investigate failed runs.
193+
# A later step in this "job" will fail the job if this step fails
194+
continue-on-error: true
195+
with:
196+
api-level: ${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}
197+
arch: x86_64
198+
force-avd-creation: false
199+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
200+
disable-animations: true
201+
script: |
202+
set -eux && ./gradlew ${{ (inputs.gradleInfoLog && '--info') || '' }} :firebase-dataconnect:connectedCheck :firebase-dataconnect:connectors:connectedCheck
203+
204+
- name: Upload log file artifacts
205+
uses: actions/upload-artifact@v4
206+
with:
207+
name: integration_test_logs
208+
path: "**/*.log"
209+
if-no-files-found: warn
210+
compression-level: 9
211+
212+
- name: Upload Gradle build report artifacts
213+
uses: actions/upload-artifact@v4
214+
with:
215+
name: integration_test_gradle_build_reports
216+
path: firebase-dataconnect/**/build/reports/
217+
if-no-files-found: warn
218+
compression-level: 9
219+
220+
- name: Verify "Gradle connectedCheck" step was successful
221+
if: steps.connectedCheck.outcome != 'success'
222+
run: |
223+
echo 'Failing because the outcome of the "Gradle connectedCheck" step ("${{ steps.connectedCheck.outcome }}") was not successful'
224+
exit 1
225+
226+
# Check this yml file with "actionlint": https://github.com/rhysd/actionlint
227+
# To run actionlint yourself, run `brew install actionlint` followed by
228+
# `actionlint .github/workflows/dataconnect.yml`
229+
actionlint-dataconnect-yml:
230+
continue-on-error: false
231+
runs-on: ubuntu-latest
232+
steps:
233+
- uses: actions/checkout@v4
234+
with:
235+
show-progress: false
236+
- uses: docker://rhysd/actionlint:1.7.7
237+
with:
238+
args: -color /github/workspace/.github/workflows/dataconnect.yml

0 commit comments

Comments
 (0)