Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 8fb0107

Browse files
authored
Merge pull request #31 from target/JordanSussman-patch-1
feat(github actions): replace travis
2 parents a4eae2f + b13930e commit 8fb0107

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/go.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Go
2+
on: [push]
3+
jobs:
4+
5+
build:
6+
name: Build
7+
runs-on: ubuntu-latest
8+
steps:
9+
10+
- name: Set up Go 1.12
11+
uses: actions/setup-go@v1
12+
with:
13+
go-version: 1.12
14+
id: go
15+
16+
- name: Check out code into the Go module directory
17+
uses: actions/checkout@v1
18+
with:
19+
path: src/github.com/target/go-arty
20+
21+
- name: Get dependencies
22+
run: |
23+
go get -v -t -d ./...
24+
if [ -f Gopkg.toml ]; then
25+
mkdir /home/runner/work/go-arty/bin
26+
export GOPATH=/home/runner/work/go-arty
27+
export PATH=$PATH:/home/runner/work/go-arty/bin
28+
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
29+
dep ensure
30+
fi
31+
32+
- name: Build
33+
run: |
34+
export GOPATH=/home/runner/work/go-arty
35+
go test -v -race ./...
36+
# Check that go vet ./... produces a zero diff; clean up any changes afterwards.
37+
go vet ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code)
38+
# Check that go fmt ./... produces a zero diff; clean up any changes afterwards.
39+
go fmt ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code)
40+
# Check that go generate ./... produces a zero diff; clean up any changes afterwards.
41+
go generate -x ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code)
42+

0 commit comments

Comments
 (0)