-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (66 loc) · 1.74 KB
/
Copy pathgo.yml
File metadata and controls
78 lines (66 loc) · 1.74 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
name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: testdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: secret
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres -d testdb"
--health-interval=10s
--health-timeout=5s
--health-retries=10
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Wait for PostgreSQL
run: |
until pg_isready -h localhost -U postgres -d testdb; do
sleep 2
done
env:
PGPASSWORD: secret
- name: Install PostgreSQL client
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
- name: Create database schema
env:
PGPASSWORD: secret
run: |
psql -h localhost \
-U postgres \
-d testdb \
-f static/schema/schema.sql
- name: Update foxden.yaml
run: |
cat >> foxden.yaml <<'EOF'
CalibrationData:
DBUri: postgres://postgres:secret@localhost:5432/testdb?sslmode=disable
WebServer:
Name: foxden-calibration-service
Port: 8399
Verbose: 1
LogFile: /tmp/CalibrationService.log
LogLongFile: true
GinOptions:
DisableConsoleColor: true
EOF
- name: Build
run: make
- name: Test
run: make test