-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (45 loc) · 1.12 KB
/
ci.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
name: ci
on:
push:
branches:
- 'master'
pull_request:
jobs:
test:
name: Run Tests
runs-on: ubuntu-20.04
strategy:
matrix:
go: [ '1.21.x', '1.20.x', '1.19.x' ]
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: tata_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Install Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Checkout
uses: actions/checkout@v2
- name: Cache Modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-v1-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests
run: go test -p 1 -v ./...
env:
POSTGRES_URL: postgres://postgres:postgres@localhost:5432/tata_test?sslmode=disable