From 51e363bac1d76c99bdb8cdcef3e5c720c8db59c5 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Fri, 20 Sep 2019 09:38:59 +0200 Subject: [PATCH] add ci action workflow (#50) add action workflow We should keep following https://github.com/actions/setup-go/issues/12 to reduce custom GOPATH configs and PATH adjustments. --- .github/workflows/push.yml | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/push.yml diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 00000000..be43396a --- /dev/null +++ b/.github/workflows/push.yml @@ -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