Firebase-tools: How to run `firebase emulators:exec` on github actions?

Created on 6 Jun 2020  ·  3Comments  ·  Source: firebase/firebase-tools

I'm trying to make this working on Github Actions by running firebase emulators:exec, but this command requires java.

I'm receiving

Error: firestore: Firestore Emulator has exited because java is not installed, you can install it from https://openjdk.java.net/install/

on Github Actions CI when on step...

      - name: Setting-up JAVA
        uses: actions/[email protected]
        with: 
          java-version: "12.x"
      - name: Test
        uses: w9jds/[email protected]
        env:
          JAVA_HOME: ${{ env.JAVA_HOME }}
          FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
          GCLOUD_PROJECT: ${{ secrets.nextGCLOUD_PROJECT }}
          PROJECT_ID: ${{ secrets.nextFIREBASE_PROJECTID }}
        with:
          args: emulators:exec --only functions,firestore \"npm run test --exit -- --forceExit --detectOpenHandles\"

I already post this question on Stackoverflow but still no answer.

I was thinking if anyone here can help me with that?

Most helpful comment

@Ridermansb I've never had any problem running emulators:exec in GitHub actions, here's an example:
https://github.com/firebase/firebase-admin-python/blob/master/.github/workflows/ci.yml#L32

I didn't even have to install Java, it twas already on ubuntu-latest. You might want to run java -version inside your action and see what is reported.

I have a feeling this is related to w9jds/firebase-action which is not an official tool. I would suggest opening an issue with them.

Installing firebase-tools globally works, yeah

All 3 comments

@Ridermansb I've never had any problem running emulators:exec in GitHub actions, here's an example:
https://github.com/firebase/firebase-admin-python/blob/master/.github/workflows/ci.yml#L32

I didn't even have to install Java, it twas already on ubuntu-latest. You might want to run java -version inside your action and see what is reported.

I have a feeling this is related to w9jds/firebase-action which is not an official tool. I would suggest opening an issue with them.

@samtstern I'm using ubuntu-16.04 .. maybe it's that. I will try change to ubuntu-latest

@Ridermansb I've never had any problem running emulators:exec in GitHub actions, here's an example:
https://github.com/firebase/firebase-admin-python/blob/master/.github/workflows/ci.yml#L32

I didn't even have to install Java, it twas already on ubuntu-latest. You might want to run java -version inside your action and see what is reported.

I have a feeling this is related to w9jds/firebase-action which is not an official tool. I would suggest opening an issue with them.

Installing firebase-tools globally works, yeah

Was this page helpful?
0 / 5 - 0 ratings