Skip to content

Commit

Permalink
👷 go test workflow with firebase emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
Shion1305 committed Apr 13, 2024
1 parent 5db8c75 commit d667c38
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build-imagemagick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/a-company-jp/imagemagick
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
packages: write
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/go-test-firebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: GoTestFirebaseEmulator
on:
push:
branches:
- main
- develop
pull_request:
paths:
- '**.go'
- '.github/**'
jobs:
go-test-with-firebase-emulator:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
cache: true
- name: Download Go modules
shell: bash
if: ${{ steps.setup-go.outputs.cache-hit != 'true' }}
run: go mod download
- 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
ENV_LOCATION: ${{ vars.GITHUB_WORKSPACE }}/pkg/setting/files/setting.testing.yaml
run: go test -p=1 -race -coverprofile=coverage.txt -covermode=atomic ./... #gosetup

0 comments on commit d667c38

Please sign in to comment.