From 610d40a25b93bcd19c571c5895ef86ebf9f483dd Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 23 Oct 2020 13:10:49 +0200 Subject: [PATCH] Split up workflows and automatically pick latest Go version --- .github/workflows/build.yml | 15 +++------------ .github/workflows/coverage.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da8fa41..c9a8bef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ jobs: build: strategy: matrix: - go-version: [1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x] + go-version: [~1.13, ^1] os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} env: @@ -14,12 +14,12 @@ jobs: TERM: "xterm-256color" steps: - name: Install Go - uses: actions/setup-go@v1 + uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Download Go modules run: go mod download @@ -30,12 +30,3 @@ jobs: - name: Test run: go test ./... if: matrix.os != 'windows-latest' - - - name: Coverage - env: - COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - go test -race -covermode atomic -coverprofile=profile.cov ./... - GO111MODULE=off go get github.com/mattn/goveralls - $(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github - if: matrix.go-version == '1.15.x' && matrix.os == 'ubuntu-latest' diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..01c10d2 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,28 @@ +name: coverage +on: [push, pull_request] + +jobs: + coverage: + strategy: + matrix: + go-version: [^1] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + env: + GO111MODULE: "on" + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Coverage + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + go test -race -covermode atomic -coverprofile=profile.cov ./... + GO111MODULE=off go get github.com/mattn/goveralls + $(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github