-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (33 loc) · 903 Bytes
/
Copy pathbuild.yml
File metadata and controls
38 lines (33 loc) · 903 Bytes
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
name: build
on: [push]
jobs:
test:
name: Test
runs-on: ubuntu-latest
container:
image: golang:buster
steps:
- name: checkout
run: |
git clone https://github.com/$GITHUB_REPOSITORY /go/src/$GITHUB_REPOSITORY
cd /go/src/$GITHUB_REPOSITORY
git checkout $GITHUB_REF
- name: Get dependencies
run: |
cd /go/src/$GITHUB_REPOSITORY
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
go get github.com/golang/dep/cmd/dep
go build github.com/golang/dep/cmd/dep
dep ensure
fi
- name: unit tests
run: |
cd /go/src/$GITHUB_REPOSITORY
echo "" > coverage.txt
sh test.sh
- name: code coverage
if: github.ref == 'refs/heads/master'
run: |
cd /go/src/$GITHUB_REPOSITORY
curl -s https://codecov.io/bash | bash