-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.21 KB
/
Copy pathgo.yml
File metadata and controls
52 lines (43 loc) · 1.21 KB
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
name: CI
on: [push, pull_request]
jobs:
test-and-build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpassword
POSTGRES_DB: controlplane_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out repository code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: Apply migrations
env:
PGPASSWORD: testpassword
run: |
for f in migrations/*.sql; do
psql -h localhost -U testuser -d controlplane_test -f "$f"
done
- name: Run Go tests
env:
TEST_DATABASE_URL: postgres://testuser:testpassword@localhost:5432/controlplane_test?sslmode=disable
run: go test -v -count=1 ./...
- name: Build application
run: go build -v ./...
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.11