-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.02 KB
/
main.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
name: MainTest
on:
push:
branchs:
- main
branches-ignore:
- dev
pull_request:
branches:
branches-ignore:
- main
- dev
jobs:
test:
name: Lint-UT
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Setup PostgreSQL
uses: Harmon758/postgresql-action@v1.0.0
with:
postgresql version: '15'
postgresql user: 'tao'
postgresql password: '123456qwe'
- name: Check out code
uses: actions/checkout@v2
- name: Lint Go Code
run: |
go install golang.org/x/lint/golint@latest
golint -set_exit_status $(go list ./... | grep -v vendor)
- name: Run Unit tests.
run: |
chmod +x test.sh
./test.sh
- name: Upload Coverage report to CodeCov
uses: codecov/codecov-action@v2
with:
file: ./coverage.txt