-
Notifications
You must be signed in to change notification settings - Fork 13
63 lines (53 loc) · 1.41 KB
/
master.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
name: master
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
env:
GIN_MODE: release
DATABASE__HOST: 127.0.0.1
DATABASE__NAME: goadmin
DATABASE__PORT: 5432
DATABASE__ENV: native
DATABASE__USER: postgres
DATABASE__PASSWORD: 1234
DATABASE__SSLMODE: disable
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: goadmin
POSTGRES_PASSWORD: 1234
ports:
- 5432:5432
redis:
image: redis:alpine
ports:
- 6379:6379
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Setup SSH Keys and known_hosts
uses: webfactory/ssh-agent@v0.4.1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Cache Go modules
uses: actions/cache@preview
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Go Test
run: |
make startup
go test -timeout 9000s -a -v -coverpkg=./... ./test -coverprofile coverage.out -json > report.json