-
Notifications
You must be signed in to change notification settings - Fork 65
45 lines (45 loc) · 1.32 KB
/
test-postgres.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
on:
push:
branches:
- master
- main
paths:
- 'postgres/**'
pull_request:
paths:
- 'postgres/**'
name: "Tests Postgres"
jobs:
Tests:
runs-on: ubuntu-latest
services:
postgres:
image: 'postgres:latest'
ports:
- '5432:5432'
env:
POSTGRES_DB: fiber
POSTGRES_USER: username
POSTGRES_PASSWORD: "pass#w%rd"
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
--health-retries 5
strategy:
matrix:
go-version:
- 1.19.x
- 1.20.x
- 1.21.x
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '${{ matrix.go-version }}'
- name: Run Test
run: cd ./postgres && go test ./... -v -race
env:
POSTGRES_DATABASE: fiber
POSTGRES_USERNAME: username
POSTGRES_PASSWORD: "pass#w%rd"