generated from caicloud/golang-template-project
-
Notifications
You must be signed in to change notification settings - Fork 61
52 lines (49 loc) · 1.5 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
48
49
50
51
52
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
ormb-unit-test:
runs-on:
#- self-hosted
- ubuntu-latest
timeout-minutes: 60
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.17
id: go
- uses: actions/checkout@v2
with:
path: src/github.com/kleveross/ormb
- name: setup env
run: |
cd src/github.com/kleveross/ormb
pwd
go env
echo "GOPATH=$(go env GOPATH):$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: install
run: |
cd src/github.com/kleveross/ormb
go env GOROOT
make build
- name: script
run: |
cd src/github.com/kleveross/ormb
go test -mod=vendor ./pkg/... -race -covermode atomic -coverprofile profile.cov
- name: send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
working-directory: src/github.com/kleveross/ormb
flag-name: unit-test
parallel: true