Skip to content

Commit

Permalink
add ci action workflow (#50)
Browse files Browse the repository at this point in the history
add action workflow

We should keep following actions/setup-go#12 to reduce custom GOPATH configs and PATH adjustments.
  • Loading branch information
gesellix committed Sep 20, 2019
1 parent f3eb7c4 commit 51e363b
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Go
on: [push]
jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.12
uses: actions/setup-go@v1
with:
go-version: 1.12
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
fetch-depth: 1
path: go/src/github.com/gesellix/couchdb-prometheus-exporter

- name: Get dependencies
run: |
mkdir -p $GOPATH/bin
export PATH=$PATH:$GOPATH/bin
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
env:
GOPATH: /home/runner/work/couchdb-prometheus-exporter/go

- name: Check
run: |
cd $GOPATH/src/github.com/gesellix/couchdb-prometheus-exporter
./integrationtest-setup.sh
go test -v ./...
./integrationtest-teardown.sh
env:
GOPATH: /home/runner/work/couchdb-prometheus-exporter/go

- name: Build
run: go build -v ./...
env:
GOPATH: /home/runner/work/couchdb-prometheus-exporter/go

0 comments on commit 51e363b

Please sign in to comment.