-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.42 KB
/
lint.yaml
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
55
56
57
58
59
60
61
62
name: Run Linter
on:
pull_request:
branches:
- dev
- staging
- main
jobs:
lint:
runs-on: self-hosted
services:
postgres:
image: postgres:14.0
env:
POSTGRES_DB: subnet_db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5.0.2
with:
go-version: 1.22
- name: Wait for Postgres to be available
run: |
for i in `seq 1 30`; do
nc -z localhost 5432 && echo Success && exit 0
echo -n .
sleep 1
done
echo Failed waiting for Postgres && exit 1
- name: Tidy Go Modules
run: go mod tidy
- name: Generate Prisma Client
env:
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/subnet_db"
run: go run github.com/steebchen/prisma-client-go generate
- name: Build cmd/server/main.go
run: go build -v cmd/server/main.go
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout 3m --config .golangci.yml