Skip to content

Test firebase emulator #192

Test firebase emulator

Test firebase emulator #192

Workflow file for this run

name: Run Tests
on:
push:
branches:
- main
- staging
- frontend-websocket-test
pull_request:
branches:
- main
- staging
workflow_dispatch:
jobs:
test-firebase:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up .env
env:
QUESTION_FIREBASE_CREDENTIAL_PATH: ${{ vars.QUESTION_SERVICE_FIREBASE_CREDENTIAL_PATH }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
run: |
cd ./apps/question-service
echo "FIREBASE_CREDENTIAL_PATH=$QUESTION_FIREBASE_CREDENTIAL_PATH" >> .env
echo "JWT_SECRET=$JWT_SECRET" >> .env
- name: Set up credentials
env:
QUESTION_FIREBASE_JSON: ${{ secrets.QUESTION_SERVICE_FIREBASE_CREDENTIAL }}
QUESTION_FIREBASE_CREDENTIAL_PATH: ${{ vars.QUESTION_SERVICE_FIREBASE_CREDENTIAL_PATH }}
run: |
cd ./apps/question-service
echo "$QUESTION_FIREBASE_JSON" > "./$QUESTION_FIREBASE_CREDENTIAL_PATH"
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23.x'
- name: Install dependencies
run: |
cd ./apps/question-service
go mod tidy
- name: Run tests with emulator
uses: w9jds/firebase-action@master
with:
args: emulators:start --only firestore --project demo-test-project
env:
GCP_SA_KEY: '{}'