Merge pull request #805 from yuki0920/fix/cloudrun-service-deploy #334
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: Go test | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./go | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go/go.mod | |
cache: true | |
- name: Cache Tools | |
id: cache-tools | |
uses: actions/cache@v4 | |
with: | |
path: ~/go/bin # /home/runner/go/bin | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
- name: Install tools | |
if: steps.cache-tools.outputs.cache-hit != 'true' | |
run: make install/tools | |
- name: Test | |
run: make test | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
DATABASE_HOST_URL: "postgres://postgres:password@localhost:5432/" | |
POSTGRES_TEST_NAME: company_ranking_test | |
POSTGRES_TEST_USER: postgres_test | |
DATABASE_TEST_URL: "postgres://postgres_test:password@localhost:5432/company_ranking_test?sslmode=disable" | |
- name: Coverage report | |
uses: k1LoW/octocov-action@v1 | |
with: | |
config: go/.octocov.yml |