From f1dfae9d6d800e42a7d5b2728bcc851de056f903 Mon Sep 17 00:00:00 2001 From: Sergio Andres Virviescas Santana Date: Mon, 21 Jun 2021 13:06:16 +0200 Subject: [PATCH] Add github actions --- .github/workflows/build.yml | 21 +++++++++++++++++++++ .github/workflows/test.yml | 35 +++++++++++++++++++++++++++++++++++ .travis.yml | 37 ------------------------------------- 3 files changed, 56 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6108be7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,21 @@ +name: Build +on: [push, pull_request] +jobs: + test: + strategy: + matrix: + go-version: [1.15.x, 1.16.x] + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - run: go version + - run: go get -t -v ./... + - run: GOOS=linux go build + - run: GOOS=darwin go build + - run: GOOS=freebsd go build + - run: GOOS=windows go build + - run: GOARCH=386 go build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..3015514 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +name: Test +on: [push, pull_request] +jobs: + test: + strategy: + matrix: + go-version: [1.15.x, 1.16.x] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - run: go version + - run: go get -t -v ./... + - run: go test -v -cover -race ./... + + - name: Send coverage + uses: shogo82148/actions-goveralls@v1 + with: + flag-name: Go-${{ matrix.os }}-${{ matrix.go-version }} + parallel: true + + finish: + needs: test + strategy: + matrix: + go-version: [1.15.x, 1.16.x] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: shogo82148/actions-goveralls@v1 + with: + parallel-finished: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 883352f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: go - -os: - - linux - - osx - - windows - -go: - - 1.16.x - - 1.15.x - - 1.14.x - - 1.13.x - - 1.12.x - - tip - -before_script: - - go get -u -v github.com/mattn/goveralls - - go get -t -v ./... - -script: - - go test -v -cover -race ./... -coverprofile=.coverprofile - - # send coverage - - $HOME/gopath/bin/goveralls -coverprofile=.coverprofile -service=travis-ci - -jobs: - allow_failures: - - go: tip - - include: - - stage: cross compilation - script: - - GOOS=linux go build - - GOOS=darwin go build - - GOOS=freebsd go build - - GOOS=windows go build - - GOARCH=386 go build