-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (45 loc) · 1.18 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
name: Go
on: [push, pull_request]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.20
- name: Check out code
uses: actions/checkout@v1
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.45.2
test:
name: Test and Build
runs-on: ubuntu-latest
container: golang:1.20-bullseye
services:
postgres:
image: postgres:15.2
env:
POSTGRES_USER: eelbot
POSTGRES_PASSWORD: testpassword
# 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: Check out code
uses: actions/checkout@v1
- name: Test
env:
TEST_POSTGRESQL_URL: postgresql://eelbot:testpassword@postgres:5432/eelbot
run: |
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
- name: Build
run: |
go build -buildvcs=false -o ./bin/ ./cmd/...