-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.13 KB
/
go.yml
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
name: Go
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.3'
- name: Build
run: go build ./cmd/formify/main.go
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.3'
- name: Start PostgreSQL
run: |
docker run -d \
--name postgres \
-e POSTGRES_DB=formify_test \
-e POSTGRES_USER=gh_action_user \
-e POSTGRES_PASSWORD=gh_action_user_password \
-p 5432:5432 \
postgres
- name: Run tests
env:
TEST_DB_HOST: localhost
TEST_DB_PORT: 5432
TEST_DB_NAME: formify_test
TEST_DB_USER: gh_action_user
TEST_DB_PASSWORD: gh_action_user_password
run: go test -v ./tests/...