From 22dc179ef957352809f079fb399cf5dd6252ddcf Mon Sep 17 00:00:00 2001 From: Quentin Renard Date: Wed, 26 Jul 2023 16:20:19 +0200 Subject: [PATCH] Added github action --- .github/workflows/go.yml | 36 ++++++++++++++++++++++++++++++++++++ .travis.yml | 15 --------------- 2 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/go.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..ce28393 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,36 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Go + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Install dependencies + run: go mod download + + - name: Run tests + run: go test -race -covermode atomic -coverprofile=covprofile ./... + + - name: Install goveralls + run: go install github.com/mattn/goveralls@latest + + - name: Send coverage + env: + COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} + run: goveralls -coverprofile=covprofile -service=github diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 05ca03d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go -go: -- 1.x -- tip -install: -- go get -t ./... -- go get golang.org/x/tools/cmd/cover -- go get github.com/mattn/goveralls -- go install github.com/mattn/goveralls -matrix: - allow_failures: - - go: tip -script: -- go test -race -v -coverprofile=coverage.out -- $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci \ No newline at end of file