Skip to content

Merge pull request #810 from yuki0920/dependabot/go_modules/go/go-dep… #346

Merge pull request #810 from yuki0920/dependabot/go_modules/go/go-dep…

Merge pull request #810 from yuki0920/dependabot/go_modules/go/go-dep… #346

Workflow file for this run

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