Skip to content

Commit 3578dd1

Browse files
committed
Configure CI
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
1 parent 5c74fbd commit 3578dd1

File tree

1 file changed

+42
-4
lines changed

1 file changed

+42
-4
lines changed

.github/workflows/main.yaml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ on:
1010

1111
jobs:
1212
quality-check:
13-
runs-on: "ubuntu-latest"
13+
runs-on: "ubuntu-24.04"
1414

1515
steps:
16-
- uses: "actions/checkout@v4"
17-
- uses: "actions/setup-go@v4"
16+
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
17+
- uses: "actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c" # v6.4.0
1818
with:
1919
go-version: "1.25"
20-
- uses: "actions/cache@v3"
20+
- uses: "actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7" # v5.0.4
2121
with:
2222
path: "~/.cache/go-build"
2323
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
@@ -37,3 +37,41 @@ jobs:
3737
echo "$diff"
3838
exit 1
3939
fi
40+
41+
test:
42+
runs-on: "ubuntu-24.04"
43+
44+
services:
45+
postgres:
46+
image: "postgres:16"
47+
env:
48+
POSTGRES_USER: "postgres"
49+
POSTGRES_PASSWORD: "postgres"
50+
ports:
51+
- "5432:5432"
52+
options: >-
53+
--health-cmd pg_isready
54+
--health-interval 10s
55+
--health-timeout 5s
56+
--health-retries 5
57+
58+
steps:
59+
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
60+
- uses: "actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c" # v6.4.0
61+
with:
62+
go-version: "1.25"
63+
- uses: "actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7" # v5.0.4
64+
with:
65+
path: "~/.cache/go-build"
66+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
67+
restore-keys: |
68+
${{ runner.os }}-go-
69+
- name: "Setup test database"
70+
run: |
71+
PGPASSWORD=postgres psql -h localhost -U postgres <<-EOF
72+
CREATE USER kit WITH SUPERUSER PASSWORD 'kit';
73+
CREATE DATABASE kit_test;
74+
GRANT ALL PRIVILEGES ON DATABASE kit_test TO kit;
75+
EOF
76+
PGPASSWORD=kit psql -h localhost -U kit -d kit_test -c "ALTER SCHEMA public OWNER TO kit;"
77+
- run: "go test -v -count=1 ./..."

0 commit comments

Comments
 (0)