Browse Source

Use matrix strategy for building on multiple platforms

ayntgl 4 years ago
parent
commit
3917bbe234
2 changed files with 12 additions and 2 deletions
  1. 9 2
      .github/workflows/ci.yml
  2. 3 0
      Makefile

+ 9 - 2
.github/workflows/ci.yml

@@ -3,17 +3,24 @@ on: [push, pull_request]
 
 jobs:
   build:
-    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        os: [ubuntu-latest, windows-latest, macos-latest]
+    runs-on: ${{ matrix.os }}
     steps:
       - name: Checkout
         uses: actions/checkout@v2
+
       - name: Setup Go
         uses: actions/setup-go@v2
         with:
           go-version: '^1.17'
+
       - name: Format
-        run: gofmt -d -e -s .
+        run: make fmt
+
       - name: Build
         run: make build
+
       - name: Test
         run: make test

+ 3 - 0
Makefile

@@ -4,5 +4,8 @@ build:
 test:
 	go test -v ./...
 
+fmt:
+	gofmt -d -e -s .
+
 clean:
 	go clean