Use build matrix instead of having seperate builds for every platform
MODIFY
.github/workflows/build.yml
.github/workflows/build.yml
name: Build
on: push
jobs:
- linux:
- name: Linux build
- runs-on: ubuntu-latest
+ tests-and-builds:
+ name: Tests and builds
+ strategy:
+ matrix:
+ platform: [ubuntu-latest, macos-latest, windows-latest]
+ runs-on: ${{ matrix.platform }}
steps:
- - name: Go 1.12 build ubuntu
- uses: actions/setup-go@v1
- with:
- version: 1.12
-
- - name: Checkout master
- uses: actions/checkout@master
-
- - name: Run tests and build
- env:
- GO111MODULE: on
- run: go test ./... && go build .
- windows:
- name: Windows build
- runs-on: windows-latest
- steps:
- - name: Go 1.12 build Windows
+ - name: Go 1.12 build Mac OS
uses: actions/setup-go@v1
with:
version: 1.12
@@ -29,25 +16,12 @@ jobs:
- name: Checkout master
uses: actions/checkout@master
- - name: Run tests and build
+ - name: Run tests
env:
GO111MODULE: on
- run: go test ./...; go build .
- shell: powershell
-
- macos:
- name: Mac OS build
- runs-on: macos-latest
- steps:
- - name: Go 1.12 build Mac OS
- uses: actions/setup-go@v1
- with:
- version: 1.12
-
- - name: Checkout master
- uses: actions/checkout@master
+ run: go test ./...
- - name: Run tests and build
+ - name: Run build
env:
GO111MODULE: on
- run: go test ./... && go build .
+ run: go build .

Use build matrix instead of having seperate builds for every platform