demo: fix warning #306
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: main | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
services: | |
emulator: | |
image: gcr.io/cloud-spanner-emulator/emulator | |
ports: | |
- 9010:9010 | |
- 9020:9020 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- name: Test using emulator | |
run: | | |
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-400.0.0-linux-x86_64.tar.gz | |
tar xvzf google-cloud-sdk-400.0.0-linux-x86_64.tar.gz && ./google-cloud-sdk/install.sh --quiet | |
gcloud config configurations create emulator | |
gcloud config set auth/disable_credentials true | |
gcloud config set project test-project | |
gcloud config set api_endpoint_overrides/spanner http://localhost:9020/ | |
gcloud spanner instances create test-instance --config=emulator-config --description="Test Instance" --nodes=1 | |
export SPANNER_EMULATOR_HOST=localhost:9010 | |
gcloud spanner databases create testdb --instance=test-instance --ddl-file=$PWD/testdata/emuddl.sql | |
go test -v -run TestBasic |