-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (66 loc) · 2.15 KB
/
test.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: test
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
go-version: ['>=1.18.0']
os: [ubuntu-latest,]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Unshallow git checkout
run: git fetch --prune --unshallow
- name: Run tests
run: go test -v -covermode=count -coverprofile=coverage.out ./...
- name: Convert coverage to lcov
uses: jandelgado/[email protected]
- name: Report coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
test-integration:
strategy:
matrix:
go-version: ['>=1.18.0']
os: [ubuntu-latest,]
runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres
env:
POSTGRES_HOST: localhost
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test
ports:
- 5445:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Unshallow git checkout
run: git fetch --prune --unshallow
- name: Run tests
run: |
cd tests/
go test -v -count=1 -cover -covermode=count -coverprofile=coverage.out ./...
doc:
name: Refresh documentation
runs-on: ubuntu-latest
steps:
- name: Pull new module version
run: go install github.com/josuebrunel/clausify@latest
env:
GOPROXY: https://proxy.golang.org
GO111MODULE: on