build for matrix of os & go versions

This commit is contained in:
Gabriel Augendre 2024-03-27 22:17:29 +01:00
parent 31fa0cfa64
commit 01653ec5e6
2 changed files with 24 additions and 21 deletions

View file

@ -1,6 +1,3 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
@ -9,20 +6,24 @@ on:
pull_request:
branches: [ "master" ]
permissions:
contents: read
pull-requests: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.21', '1.22']
os: [macos-latest, windows-latest, ubuntu-latest]
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./... -race
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./... -race

View file

@ -12,15 +12,17 @@ permissions:
jobs:
golangci:
strategy:
matrix:
go: ['1.21', '1.22']
os: [macos-latest, windows-latest, ubuntu-latest]
name: lint
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: ${{ matrix.go }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with: