Skip to content

Commit acb8586

Browse files
committed
dataconnect.yml: setup auth emulator
1 parent c975260 commit acb8586

File tree

1 file changed

+34
-8
lines changed

1 file changed

+34
-8
lines changed

.github/workflows/dataconnect.yml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
inputs:
66
javaVersion:
77
androidEmulatorApiLevel:
8+
nodeJsVersion:
9+
firebaseToolsVersion:
810
gradleInfoLog:
911
type: boolean
1012
pull_request:
@@ -17,8 +19,12 @@ on:
1719
- cron: '0 11 * * *' # Run nightly at 11am UTC (3am Pacific, 6am Eastern)
1820

1921
env:
20-
FST_JAVA_VERSION: ${{ inputs.javaVersion || '17' }}
21-
FST_ANDROID_EMULATOR_API_LEVEL: ${{ inputs.androidEmulatorApiLevel || '34' }}
22+
FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }}
23+
FDC_ANDROID_EMULATOR_API_LEVEL: ${{ inputs.androidEmulatorApiLevel || '34' }}
24+
FDC_NODEJS_VERSION: ${{ inputs.nodeJsVersion || '20' }}
25+
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '13.29.1' }}
26+
FDC_FIREBASE_TOOLS_DIR: ${{ github.workspace }}/firebase-tools
27+
FDC_FIREBASE_COMMAND: ${{ github.workspace }}/firebase-tools/node_modules/.bin/firebase
2228

2329
concurrency:
2430
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -49,9 +55,21 @@ jobs:
4955

5056
- uses: actions/setup-java@v4
5157
with:
52-
java-version: ${{ env.FST_JAVA_VERSION }}
58+
java-version: ${{ env.FDC_JAVA_VERSION }}
5359
distribution: temurin
5460

61+
- uses: actions/setup-node@v3
62+
with:
63+
node-version: ${{ env.FST_NODEJS_VERSION }}
64+
65+
- name: install firebase-tools
66+
run: |
67+
set -v
68+
mkdir -p ${{ env.FDC_FIREBASE_TOOLS_DIR }}
69+
cd ${{ env.FDC_FIREBASE_TOOLS_DIR }}
70+
echo '{}' > package.json
71+
npm install --fund=false --audit=false --save --save-exact firebase-tools@${{ env.FST_FIREBASE_TOOLS_VERSION }}
72+
5573
- name: tool versions
5674
continue-on-error: true
5775
run: |
@@ -62,6 +80,10 @@ jobs:
6280
which javac
6381
javac -version
6482
./gradlew --version
83+
which node
84+
node --version
85+
${{ env.FST_FIREBASE_COMMAND }} --version
86+
./gradlew --version
6587
6688
- name: Gradle assembleDebugAndroidTest
6789
run: |
@@ -89,15 +111,15 @@ jobs:
89111
path: |
90112
~/.android/avd/*
91113
~/.android/adb*
92-
key: avd-cache-zhdsn586je-api${{ env.FST_ANDROID_EMULATOR_API_LEVEL }}-ref${{ github.ref_name }}
114+
key: avd-cache-zhdsn586je-api${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}-ref${{ github.ref_name }}
93115
restore-keys: |
94-
avd-cache-zhdsn586je-api${{ env.FST_ANDROID_EMULATOR_API_LEVEL }}-
116+
avd-cache-zhdsn586je-api${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}-
95117
96118
- name: Create AVD and generate snapshot for caching
97119
if: steps.avd-cache.outputs.cache-hit != 'true'
98120
uses: reactivecircus/android-emulator-runner@v2
99121
with:
100-
api-level: ${{ env.FST_ANDROID_EMULATOR_API_LEVEL }}
122+
api-level: ${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}
101123
arch: x86_64
102124
force-avd-creation: false
103125
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
@@ -115,12 +137,16 @@ jobs:
115137
:firebase-dataconnect:connectors:runDebugDataConnectEmulator \
116138
2>&1 >dataconnect.emulator.log &
117139
118-
sleep 5s
140+
- name: Firebase Auth Emulator
141+
run: |
142+
set -x
143+
cd firebase-dataconnect/emulator
144+
${{ env.FST_FIREBASE_COMMAND }} emulators:start --only=auth &
119145
120146
- name: Gradle connectedCheck
121147
uses: reactivecircus/android-emulator-runner@v2
122148
with:
123-
api-level: ${{ env.FST_ANDROID_EMULATOR_API_LEVEL }}
149+
api-level: ${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}
124150
arch: x86_64
125151
force-avd-creation: false
126152
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none

0 commit comments

Comments
 (0)