question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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/setup-java@v1.3.0
        with: 
          java-version: "12.x"
      - name: Test
        uses: w9jds/firebase-action@v1.3.1
        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?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
zachweinbergcommented, Aug 5, 2020

@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

3reactions
damienromitocommented, Oct 29, 2021

J’ai toujours l’erreur Firestore Emulator has exited because java is not installed

jobs:
  test:
    name: Test
    # needs: build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@master

      - name: Install Firebase Emulator Suite
        run: npm install -g firebase-tools@9.20.0

      - name: Install Dependencies
        run: npm install
    
      - name: Run all the tests
        run: firebase emulators:exec --only firestore --project my-project-id 'npm run test'
        env:
          FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Run firebase emulators on github actions - Stack Overflow
At the time of writing, the unofficial firebase-action has ... ci - run: firebase emulators:exec --only firestore \"npm run test --exit\".
Read more >
End-to-end testing with Firebase Emulator and Github Actions
The Firebase emulator CLI allows for importing data as it starts up. So the first step is to get an export of the...
Read more >
Deploy to live & preview channels via GitHub pull requests
Set up the GitHub Action to deploy to Firebase Hosting · If you've NOT set up Hosting, run this version of the command...
Read more >
Setting up CI with Github Actions
There are two kinds of actions: run: commands that execute basic actions, ... The script here also tells Github to cache the Firebase...
Read more >
Caching the Firebase Emulator on GitHub Actions
The step above will cache the emulator on GitHub Actions. The next time you run your tests, Firebase won't download the emulator again ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found