Skip to content

Commit 6f1b217

Browse files
authored
Merge pull request #159 from commitdev/158-run-tests-github-actions
158 run tests GitHub actions
2 parents 979e9a4 + 6e302ed commit 6f1b217

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.github/workflows/config.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- master
5+
6+
jobs:
7+
unit_test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-go@v2
12+
with:
13+
go-version: 1.12
14+
- name: Download Go Packages
15+
run: |
16+
make deps
17+
- name: Run Go Tests
18+
run: |
19+
make check

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ BUILD ?=$(shell git rev-parse --short HEAD)
33
PKG ?=github.com/commitdev/zero
44
BUILD_ARGS=-v -ldflags=all="-X ${PKG}/cmd.appVersion=${VERSION} -X ${PKG}/cmd.appBuild=${BUILD}"
55

6+
deps:
7+
go mod download
8+
69
check:
7-
go test ./...
10+
go list -f '{{.Dir}}' ./... | grep -v /tmp/ | xargs go test -v
811

912
fmt:
1013
go fmt ./...

0 commit comments

Comments
 (0)