Test firebase emulator #203
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 Go dependencies | |
run: | | |
cd ./apps/question-service | |
go mod tidy | |
- name: Install firebase tools | |
run: curl -sL firebase.tools | bash | |
- name: Try starting | |
run: firebase emulators:exec --only firestore 'cd ./apps/question-service; go test ./...' |