From 2929a8f9702183c7805785364e9c7897eae77989 Mon Sep 17 00:00:00 2001 From: eternal-flame-AD Date: Mon, 22 May 2023 16:57:53 -0500 Subject: [PATCH] move to github actions --- .github/workflows/test.yml | 37 +++++++++++++++++++++++++++++++++++++ .travis.yml | 14 -------------- 2 files changed, 37 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..912ea3d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: Test + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + go-version: [ '1.14', '1.16', '1.18', '1.20.x' ] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Go ${{ matrix.go-version }} + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + - name: Install dependencies + run: | + go mod download + - name: Run Unit tests + run: | + go test -race -covermode atomic -coverprofile=covprofile ./... + + - name: Install goveralls + if : ${{ matrix.go-version == '1.20.x' }} + run: go install github.com/mattn/goveralls@latest + + - name: Send coverage + if : ${{ matrix.go-version == '1.20.x' }} + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: goveralls -coverprofile=covprofile -service=github \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1ca2493..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: go - -go: - - "1.x" - - "1.8" - - "1.10.x" - - master -install: - - go get -t -v ./... - - go get golang.org/x/tools/cmd/cover - - go get github.com/mattn/goveralls -script: - - go test -v -covermode=count -coverprofile=coverage.out - - $(go env GOPATH | awk 'BEGIN{FS=":"} {print $1}')/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN