Skip to content

compatibility-test

compatibility-test #32

name: compatibility-test
on:
push:
paths-ignore:
- "**.md"
- LICENCE
- CODEOWNERS
branches:
- master
pull_request_review:
types: [submitted]
jobs:
compatibility-test:
# we trigger the job only when the PR is approved or the job is triggered by other events
# defined in the on section
if: github.event.review.state == 'APPROVED' || github.event_name != 'pull_request_review'
strategy:
matrix:
go-version: ["1.21", "1.22"]
os: [ubuntu-latest, macos-latest, windows-latest]
# GitHub Actions does not support arm* architectures on default
# runners. It is possible to acomplish this with a self-hosted runner
# if we want to add this in the future:
# https://docs.github.com/en/actions/hosting-your-own-runners/using-self-hosted-runners-in-a-workflow
arch: ["386", amd64]
exclude:
# Not a supported Go OS/architecture.
- os: macos-latest
arch: "386"
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- name: Module cache
uses: actions/cache@v4
env:
cache-name: go-mod-cache
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }}
- name: Run Test
env:
GOARCH: ${{ matrix.arch }}
run: make go-test