From 10b24f0ef236ed73d9a67fc7c617d651ccb25155 Mon Sep 17 00:00:00 2001 From: Cody Lee Date: Sun, 31 Oct 2021 20:53:33 -0500 Subject: [PATCH] move to github workflows --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 19 ----------------- 2 files changed, 46 insertions(+), 19 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..0dde507 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Setup Go + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: '1.17.0' # The Go version to download (if necessary) and use. + + # Install all the dependencies + - name: Install dependencies + run: | + go version + go mod download + go install golang.org/x/lint/golint@latest + go install golang.org/x/tools/cmd/cover@latest + + # Run vet & lint on the code + - name: Fmt, Lint, Vet, Test + run: | + go fmt ./... + golint ./... + go vet ./... + + # Run testing on the code + - name: Run testing + run: go test -v -race -covermode=atomic -coverprofile=covprofile ./... + + # todo: fix coverage reports... + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1641b19..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: go -go: -- 1.13 -env: - - GO111MODULE=on -addons: - apt: - packages: - - python-pygments -install: - - go get golang.org/x/tools/cmd/cover - - go get github.com/mattn/goveralls - - go get golang.org/x/lint/golint -script: - - go fmt ./... - - golint ./... - - go vet ./... - - go test -v -race -covermode=atomic -coverprofile=coverage.out ./... - - $(go env GOPATH | awk 'BEGIN{FS=":"} {print $1}')/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken=${COVERALLS_TOKEN}