-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (81 loc) · 2.16 KB
/
Copy pathci.yml
File metadata and controls
92 lines (81 loc) · 2.16 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: CI
on:
push:
branches: ["main", "master"]
pull_request:
jobs:
test-and-verify:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: qraven
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
APP_NAME: QRaven
APP_MODE: debug
APP_URL: http://localhost:8080
SERVER_PORT: 8080
SERVER_SECRET: test-secret
SERVER_ACCESSTOKENEXPIREDURATION: 24
REQUEST_PER_SECOND: 5
TRUSTED_PROXIES: "[]"
EXEMPT_FROM_THROTTLE: "[]"
DB_HOST: 127.0.0.1
DB_PORT: 5432
DB_CONNECTION: postgres
USERNAME: postgres
PASSWORD: postgres
DB_NAME: qraven
SSLMODE: disable
TIMEZONE: UTC
MIGRATE: true
TEST_DB_HOST: 127.0.0.1
TEST_DB_PORT: 5432
TEST_DB_CONNECTION: postgres
TEST_USERNAME: postgres
TEST_PASSWORD: postgres
TEST_DB_NAME: qraven
TEST_SSLMODE: disable
TEST_TIMEZONE: UTC
TEST_MIGRATE: true
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
REDIS_DB: 0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Download dependencies
run: go mod download
- name: Build
run: go build -v ./...
- name: Run tests
run: go test ./tests/*/ -v
- name: Install swag
run: go install github.com/swaggo/swag/cmd/[email protected]
- name: Regenerate swagger
run: swag init --generalInfo cmd/api/main.go --output ./docs
- name: Check swagger drift
run: git diff --exit-code -- docs/docs.go docs/swagger.json docs/swagger.yaml