-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (37 loc) · 1.14 KB
/
go test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: GoTestFirebaseEmulator
on:
push:
branches:
- main
- develop
pull_request:
paths:
- '**.go'
- '.github/**'
jobs:
go-test-with-firebase-emulator:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Checkout code
uses: actions/checkout@v2
- run: |
echo "ENV_LOCATION=$GITHUB_WORKSPACE/pkg/setting/files/setting.testing.yaml"
echo "ENV_LOCATION=$GITHUB_WORKSPACE/pkg/setting/files/setting.testing.yaml" >> $GITHUB_ENV
- name: Install firebase-emulator
run: npm install -g firebase-tools
- name: Run Firebase Emulator
run: |
firebase setup:emulators:database
firebase emulators:start --only database &
- name: 'Waiting for the emulator to start up'
run: sleep 20
- name: Run tests
env:
FIREBASE_DATABASE_EMULATOR_HOST: localhost:9000
run: go test -p=1 -race -coverprofile=coverage.txt -covermode=atomic ./... #gosetup
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3