-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (54 loc) · 1.33 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
49
50
51
52
53
54
55
56
name: CI
on: [push, pull_request]
jobs:
test:
name: Go ${{ matrix.go }}
runs-on: ubuntu-latest
strategy:
matrix:
go:
- '1.19'
- '1.20'
fail-fast: false
timeout-minutes: 10
env:
POSTGES_DB: pg_dba_test
POSTGES_HOST: "127.0.0.1"
POSTGRES_USER: postgres
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Install coverage merging tool
run: go install github.com/wadey/gocovmerge@latest
- name: Start Postgres # TODO: Come back and get rid of the sleep with a health check
run: |
docker-compose up -d
sleep 15
- name: Seed DB
env:
PGHOST: "127.0.0.1"
PGUSER: postgres
run: |
psql -c 'create database pg_dba_test;'
cat test-schema.sql | psql > /dev/null
- name: Run Tests
run: make test
- name: Upload Coverage
uses: codecov/codecov-action@v3
docker-build:
name: Docker Build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- run: docker build -t pg-dba .
docs:
name: Test Documentation Build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- run: make docs
working-directory: docs