diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml new file mode 100644 index 0000000..2f81de6 --- /dev/null +++ b/.github/workflows/linters.yml @@ -0,0 +1,25 @@ +name: Style Checkers +on: [push] +jobs: + build: + name: Check + runs-on: ubuntu-latest + steps: + + - name: Set up Go + uses: actions/setup-go@v1 + with: + go-version: 1.15.x + id: go + + - name: Install golang-ci + run: | + curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $HOME/bin latest + + - name: Check out code + uses: actions/checkout@v1 + + - name: Run golang-ci + run: | + export PATH=$HOME/bin:$PATH + golangci-lint run --enable goimports,govet,misspell,stylecheck diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..70e869c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,36 @@ +name: Build and tests +on: [push] +jobs: + build: + name: Build + strategy: + matrix: + go-version: + - 1.14.x + - 1.15.x + runs-on: ubuntu-latest + + env: + GOPROXY: https://proxy.golang.org + + steps: + + - name: Set up Go ${{ matrix.go-version }} + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Check out code + uses: actions/checkout@v1 + + - name: Build + run: | + go run build.go --goos linux + go run build.go --goos windows + go run build.go --goos darwin + + - name: Run tests + run: | + export PATH=$HOME/bin:$PATH + go test ./... diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1a06d74..0000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -os: linux -sudo: false -language: go - -go: - - "1.11.x" - - "1.12.x" - - "1.13.x" - - "1.14.x" - -branches: - only: - - master - -notifications: - email: - on_success: always - -install: - - export GOBIN="$GOPATH/bin" - - export PATH="$PATH:$GOBIN" - - export GO111MODULE=on - - export GOPROXY=https://proxy.golang.org - - go get -u golang.org/x/lint/golint - - go get golang.org/x/tools/cmd/goimports - - go get github.com/restic/calens - -script: - - export GO111MODULE=on - - export GOPROXY=https://proxy.golang.org - - go build ./cmd/rest-server - - go test ./... - - go run build.go -v -T - - diff <(goimports -d *.go) <(printf "") - - calens - -after_success: - - diff <(golint *.go) <(printf "") diff --git a/README.md b/README.md index c064f6a..02db375 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Rest Server -[![Build Status](https://travis-ci.com/restic/rest-server.svg?branch=master)](https://travis-ci.com/restic/rest-server) + +[![Status badge for tests](https://github.com/happal/monsoon/workflows/Build%20and%20tests/badge.svg)](https://github.com/happal/monsoon/actions?query=workflow%3A%22Build+and+tests%22) +[![Status badge for style checkers](https://github.com/happal/monsoon/workflows/Style%20Checkers/badge.svg)](https://github.com/happal/monsoon/actions?query=workflow%3A%22Style+Checkers%22) [![Go Report Card](https://goreportcard.com/badge/github.com/restic/rest-server)](https://goreportcard.com/report/github.com/restic/rest-server) [![GoDoc](https://godoc.org/github.com/restic/rest-server?status.svg)](https://godoc.org/github.com/restic/rest-server) [![License](https://img.shields.io/badge/license-BSD%20%282--Clause%29-003262.svg?maxAge=2592000)](https://github.com/restic/rest-server/blob/master/LICENSE)