From 8e93c3910e22114f06ff90043f3339f75725c7f7 Mon Sep 17 00:00:00 2001 From: David Hill Date: Thu, 27 Aug 2020 18:59:28 +0000 Subject: [PATCH] build: add ci via github actions (#1) --- .github/workflows/go.yml | 31 +++++++++++++++++++++++++++++++ politeia/readasset.go | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..55e869b --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,31 @@ +name: Build and Test +on: [push, pull_request] +jobs: + build: + name: Go CI + runs-on: ubuntu-latest + strategy: + matrix: + go: [1.14, 1.15] + steps: + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + - name: Check out source + uses: actions/checkout@v2 + - name: Install linters + run: "curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.30.0" + - name: Build + env: + GO111MODULE: "on" + run: go build ./... + - name: Lint + env: + GO111MODULE: "on" + run: | + golangci-lint run --disable-all --deadline=10m --enable=gofmt --enable=govet --enable=gosimple --enable=unconvert --enable=ineffassign + - name: Test + env: + GO111MODULE: "on" + run: go test -v ./... diff --git a/politeia/readasset.go b/politeia/readasset.go index 939abbe..6fcbd15 100644 --- a/politeia/readasset.go +++ b/politeia/readasset.go @@ -10,7 +10,7 @@ import ( ) var assets = map[string][]byte{ - "sample-politeiavoter.conf": []byte(sampleconfig.FileContents), + "sample-politeiavoter.conf": []byte(sampleconfig.FileContents), } func main() {