chore: fix copywrite config hcl #166
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 | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
# Label of the container job | |
sqlite: | |
strategy: | |
matrix: | |
go: ["1.21", "1.20", "1.19"] | |
platform: [ubuntu-latest] # can not run in windows OS | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 | |
- name: go mod package cache | |
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('tests/go.mod') }} | |
- name: Tests | |
run: make test-sqlite | |
- name: Coverage | |
run: | | |
make coverage-diff | |
postgres: | |
strategy: | |
matrix: | |
dbversion: ["postgres:latest"] | |
go: ["1.21", "1.20", "1.19"] | |
platform: [ubuntu-latest] # can not run in macOS and Windows | |
runs-on: ${{ matrix.platform }} | |
services: | |
postgres: | |
image: ${{ matrix.dbversion }} | |
env: | |
POSTGRES_PASSWORD: go_db | |
POSTGRES_USER: go_db | |
POSTGRES_DB: go_db | |
ports: | |
- 9920:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 | |
- name: go mod package cache | |
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('tests/go.mod') }} | |
- name: Tests | |
run: make test-postgres |