-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (48 loc) · 1.43 KB
/
main.yaml
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: main
on:
push:
branches:
- master
ignore-tags:
- 'v*'
pull_request:
jobs:
pipeline:
name: pipeline
runs-on: ubuntu-latest
services:
postgres:
image: postgres:10.8
env:
POSTGRES_USER: prana
POSTGRES_PASSWORD: prana
POSTGRES_DB: prana
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mysql:
image: mysql:5.7
env:
MYSQL_USER: prana
MYSQL_PASSWORD: prana
MYSQL_DATABASE: prana
MYSQL_ROOT_PASSWORD: prana
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Check out Code
uses: actions/checkout@v1
- name: Set up Golang
uses: actions/setup-go@v1
with:
go-version: '1.16.x'
- name: Run Tests
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
env:
TEST_PSQL_URL: "postgres://prana:prana@127.0.0.1:${{ job.services.postgres.ports[5432] }}/prana?sslmode=disable"
TEST_MYSQL_URL: "prana:prana@tcp(127.0.0.1:${{ job.services.mysql.ports['3306'] }})/prana"
- name: Upload tests coverage to codeconv.io
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}