Skip to content

Merge pull request #173 from go-generalize/dependabot/go_modules/clou… #347

Merge pull request #173 from go-generalize/dependabot/go_modules/clou…

Merge pull request #173 from go-generalize/dependabot/go_modules/clou… #347

Workflow file for this run

name: Go
on:
pull_request:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
services:
firestore:
image: google/cloud-sdk
options: -ti
env:
GO111MODULE: on
FIRESTORE_EMULATOR_HOST: localhost:8000
steps:
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@main
with:
version: "latest"
- name: Install firestore emulator
run: |
gcloud components install beta --quiet
gcloud components install cloud-firestore-emulator --quiet
- name: Start firestore emulator
run: gcloud beta emulators firestore start --host-port=localhost:8000 &
- name: Set up Go 1.18
uses: actions/setup-go@v4
with:
go-version: 1.18
id: go
- uses: actions/checkout@v3
- name: Ensure samples are generated
env:
TZ: Asia/Tokyo
run: |
export PATH=$PATH:$PWD/bin
make gen_samples
clean=$(git status | grep "nothing to commit" || true)
if [ -z "$clean" ]; then
git diff
echo 'Please run "make gen_samples"'
exit 1
fi
- name: Check firestore emulator
run: |
curl http://localhost:8000 --silent --retry 30 --retry-delay 1 --retry-connrefused
- name: Run tests
run: |
make test TEST_OPT='-tags="emulator"'