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 name: Go
on: on:
@ -9,20 +6,24 @@ on:
pull_request: pull_request:
branches: [ "master" ] branches: [ "master" ]
permissions:
contents: read
pull-requests: read
jobs: jobs:
build: 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: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-go@v5
- name: Set up Go with:
uses: actions/setup-go@v5 go-version: ${{ matrix.go }}
with: - name: Build
go-version: '1.21' run: go build -v ./...
- name: Test
- name: Build run: go test -v ./... -race
run: go build -v ./...
- name: Test
run: go test -v ./... -race

View file

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