Skip to content

Commit 8529738

Browse files
committed
Configure CI
1 parent 58a2137 commit 8529738

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- master
7+
pull_request:
8+
branches:
9+
- main
10+
- master
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-22.04
15+
16+
services:
17+
postgres:
18+
image: postgres:14
19+
env:
20+
POSTGRES_USER: postgres
21+
POSTGRES_PASSWORD: postgres
22+
POSTGRES_DB: dnote_test
23+
POSTGRES_PORT: 5432
24+
# Wait until postgres has started
25+
options: >-
26+
--health-cmd pg_isready
27+
--health-interval 10s
28+
--health-timeout 5s
29+
--health-retries 5
30+
31+
# Expose port to the host
32+
ports:
33+
- 5432:5432
34+
35+
steps:
36+
- uses: actions/checkout@v5
37+
- uses: actions/setup-go@v6
38+
with:
39+
go-version: '>=1.23.0'
40+
41+
- name: Build
42+
run: go build
43+
44+
- name: Test
45+
run: go test -v
46+
env:
47+
TEST_PG_HOST: localhost
48+
TEST_PG_PORT: 5432
49+
TEST_PG_USER: postgres
50+
TEST_PG_PASSWORD: postgres
51+
TEST_PG_DB: dnote_test

0 commit comments

Comments
 (0)