-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.29 KB
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: tests
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12-alpine
env:
POSTGRES_DB: hammer_test
POSTGRES_USER: test
POSTGRES_PASSWORD: test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Set up Go 1.23
uses: actions/setup-go@v3
with:
go-version: 1.23
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: go mod download
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
skip-pkg-cache: true
skip-build-cache: true
- name: Run tests
env:
HAMMER_TEST_DATABASE_URL: "postgres://test:test@localhost:5432/hammer_test?sslmode=disable"
run: make db-test-migrate && make test