forked from nyaruka/gocommon
-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (38 loc) · 1.11 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
name: CI
on: [push, pull_request]
jobs:
test:
name: Test
strategy:
matrix:
go-version: [1.19.x]
pg-version: ["13", "14"]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install PostgreSQL
uses: harmon758/postgresql-action@v1
with:
postgresql version: ${{ matrix.pg-version }}
postgresql db: gocommon_test
postgresql user: nyaruka
postgresql password: nyaruka
- name: Install Linux packages
run: sudo apt install -y --no-install-recommends pandoc
- name: Install Redis
uses: zhulik/redis-action@v1.0.0
with:
redis version: "6.2"
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Run tests
run: go test -p=1 -coverprofile=coverage.text -covermode=atomic ./...
- name: Upload coverage
if: success()
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true