Change the GitHub workflow to use an action which install Go using a Go version from the matrix

Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
This commit is contained in:
Cosmin Cojocar 2020-03-30 12:52:42 +02:00
parent 8de5fb6eb2
commit 5284f34b6f

View file

@ -8,31 +8,36 @@ on:
- master - master
jobs: jobs:
tests: tests:
runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
go-version: ["go1.12", "go1.13", "go1.14"] go-version: [go1.12.x, go1.13.x, go1.14.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
env: env:
GO111MODULE: "on" GO111MODULE: on
steps: steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout Source - name: Checkout Source
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Run Tests - name: Run Tests
uses: cedrickring/golang-action/${{ matrix.go-version }}@1.5.1 run: make test
with:
args: make test
coverage: coverage:
needs: tests needs: tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
GO111MODULE: "on" GO111MODULE: on
steps: steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: go1.14.x
- name: Checkout Source - name: Checkout Source
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Create Test Coverage - name: Create Test Coverage
uses: cedrickring/golang-action@1.5.1 run: make test-coverage
with:
args: make test-coverage
- name: Upload Test Coverage - name: Upload Test Coverage
uses: codecov/codecov-action@v1 uses: codecov/codecov-action@v1
with: with: