-
Notifications
You must be signed in to change notification settings - Fork 41
55 lines (53 loc) · 1.65 KB
/
compatibility-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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.22", "1.23"]
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