From 38473733806149ea3f9620660cbbb4123ad99518 Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Tue, 17 Mar 2020 01:47:58 -0700 Subject: [PATCH] Add github actions --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 24 -------------------- 2 files changed, 47 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a82e03e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: Go + +on: [push, pull_request] + +env: + GO11MODULE: on + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + steps: + - name: Set up Go + uses: actions/setup-go@v2-beta + with: + go-version: '^1.7' + + - name: Check out code + uses: actions/checkout@9a3a9ade + with: + submodules: true + + - name: Clean up extra files + run: rm ./testcases/*.go + + - name: Run golangci-lint + uses: actions-contrib/golangci-lint@v1 + env: + GOROOT: '' + with: + golangci_lint_version: 'v1.23.6' + + - name: Download deps + run: go mod download + + - name: Run tests + run: go test -race -v ./... + + - name: Submit coverage report + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + go test -covermode=count -coverprofile=profile.cov + GO111MODULE=off go get github.com/mattn/goveralls + $(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5be33ba..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: go -go: - - '1.7.x' - - stable -env: - - GO111MODULE=on - -before_install: - # Remove the go file from the test cases dir as it fails linting - - rm ./testcases/*.go - - - GO111MODULE=off go get github.com/mattn/goveralls - - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.6 - -script: - # Test - - go test -race -v ./... - - go test -covermode=count -coverprofile=profile.cov - - # Linting - - if [[ $TRAVIS_GO_VERSION != 1.7.* ]]; then golangci-lint run; fi - -after_script: - - $HOME/gopath/bin/goveralls -coverprofile=profile.cov -service=travis-ci