Skip to content

Commit

Permalink
fix: exclude arm from x64 config (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
nrwiersma authored Sep 3, 2024
1 parent c2ac60e commit 91b9f6f
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 3 deletions.
66 changes: 64 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ on:
name: run tests
jobs:
test:

runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ "1.22", "1.23" ]
runs-on: ubuntu-latest
env:
GOLANGCI_LINT_VERSION: v1.60.1

Expand Down Expand Up @@ -49,3 +48,66 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov

build:
runs-on: ubuntu-latest
strategy:
matrix:
os:
- darwin
- linux
- windows
arch:
- 386
- amd64
- arm
- arm64
- ppc64le
- s390x
include:
- os: linux
arch: arm
arm: 7
exclude:
- os: darwin
arch: 386
- os: darwin
arch: arm
- os: darwin
arch: ppc64le
- os: darwin
arch: s390x
- os: windows
arch: arm
- os: windows
arch: arm64
- os: windows
arch: ppc64le
- os: windows
arch: s390x
env:
GO_VERSION: "1.23"

steps:
- name: Install Go
if: success()
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Checkout code
uses: actions/checkout@v4

- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build avrogen
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM=${{ matrix.arm }} go build ./cmd/avrogen

- name: Build avrosv
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM=${{ matrix.arm }} go build ./cmd/avrosv
8 changes: 8 additions & 0 deletions config_arm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package avro

import "math"

// Max allocation size for an array due to the limit in number of bits in a heap address:
// https://github.com/golang/go/blob/7f76c00fc5678fa782708ba8fece63750cb89d03/src/runtime/malloc.go#L190
// 32-bit systems accept the full 32bit address space
const maxAllocSize = math.MaxInt
2 changes: 1 addition & 1 deletion config_x64.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build !386
//go:build !386 && !arm

package avro

Expand Down

0 comments on commit 91b9f6f

Please sign in to comment.