From 529b727b8ef3dbddea8ec0c8eb4d53fd23add147 Mon Sep 17 00:00:00 2001 From: Quentin Renard Date: Wed, 26 Jul 2023 17:45:18 +0200 Subject: [PATCH] Added github action --- .github/workflows/test.yml | 33 +++++++++++++++++++++++++++++++++ .travis.yml | 12 ------------ README.md | 4 ++-- 3 files changed, 35 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e1ac19d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +name: Test + +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 ./... + + - if: github.event_name != 'pull_request' + name: Send coverage + env: + COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} + run: | + go install github.com/mattn/goveralls@latest + goveralls -coverprofile=covprofile -service=github diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bdab670..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -# https://docs.travis-ci.com/user/languages/go/ -language: go -go: -- 1.8 -- 1.9 -- "1.10" -- tip -matrix: - allow_failures: - - go: tip -script: - go test -v diff --git a/README.md b/README.md index 7552cfa..ecbd421 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![GoReportCard](http://goreportcard.com/badge/github.com/asticode/go-astitodo)](http://goreportcard.com/report/github.com/asticode/go-astitodo) [![GoDoc](https://godoc.org/github.com/asticode/go-astitodo?status.svg)](https://godoc.org/github.com/asticode/go-astitodo) -[![GoCoverage](https://cover.run/go/github.com/asticode/go-astitodo.svg)](https://cover.run/go/github.com/asticode/go-astitodo) -[![Travis](https://travis-ci.org/asticode/go-astitodo.svg?branch=master)](https://travis-ci.org/asticode/go-astitodo#) +[![Test](https://github.com/asticode/go-astitodo/actions/workflows/test.yml/badge.svg)](https://github.com/asticode/go-astitodo/actions/workflows/test.yml) +[![Coveralls](https://coveralls.io/repos/github/asticode/go-astitodo/badge.svg?branch=master)](https://coveralls.io/github/asticode/go-astitodo) This is a Golang library and CLI to parse TODOs in your GO code.