GHA: Build/Test matrix for linux/windows - Go1.19/1.20/1.21 #141
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Build | |
on: | |
pull_request: {} | |
workflow_dispatch: {} | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
RUNS_ON: [ubuntu-latest, windows-2022] | |
GO_VERSION: ["1.19.x", "1.20.x", "1.21.x"] | |
runs-on: "${{ matrix.RUNS_ON }}" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup go ${{ matrix.GO_VERSION }} | |
uses: actions/setup-go@v5 | |
with: | |
cache: true | |
cache-dependency-path: v2/go.sum | |
go-version: ${{ matrix.GO_VERSION }} | |
- name: Lint linux - ${{ matrix.GO_VERSION }} | |
if: ${{ contains(matrix.RUNS_ON, 'ubuntu') }} | |
run: make lint | |
- name: Test linux - ${{ matrix.GO_VERSION }} | |
if: ${{ contains(matrix.RUNS_ON, 'ubuntu') }} | |
run: make test | |
- name: Install msys2 | |
uses: msys2/setup-msys2@v2 | |
if: ${{ contains(matrix.RUNS_ON, 'windows') }} | |
with: | |
msystem: MINGW64 | |
update: true | |
install: >- | |
git | |
base-devel | |
mingw-w64-x86_64-toolchain | |
unzip | |
- name: Lint windows - Go ${{ matrix.GO_VERSION }} | |
if: ${{ contains(matrix.RUNS_ON, 'windows') }} | |
shell: msys2 {0} | |
run: make lint | |
- name: Test windows - Go ${{ matrix.GO_VERSION }} | |
if: ${{ contains(matrix.RUNS_ON, 'windows') }} | |
shell: msys2 {0} | |
run: make test | |
# This job is just here to make sure that the other jobs have completed | |
# and is used as a single job to block PR merge from. GH doesn't have a | |
# way to say "all jobs from this action", which would be ideal. | |
success: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Shout it out | |
run: echo SUCCESS | |