Support for for linux-ARM, darwin-ARM and windows-amd64 compilation #7
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: Go | |
on: | |
pull_request: | |
paths-ignore: | |
- '**/README.md' | |
jobs: | |
build-linux: | |
strategy: | |
matrix: | |
go-version: [ '1.20.x', '1.21.x' ] | |
goos: [linux] | |
archparams: [{goarch: amd64, cc: gcc},{goarch: arm64, cc: aarch64-linux-gnu-gcc}] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install toolchain for compiling ARM | |
run: sudo apt-get -y install gcc-aarch64-linux-gnu | |
- name: Install lcrypt for arm64 | |
run: sudo dpkg --add-architecture arm64 && sudo apt-get -y update && sudo apt-get -y install libcrypt-dev:arm64 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '${{matrix.go-version}}' | |
- name: Install Go dependencies | |
run: go get ./... | |
- name: Build Client | |
run: env CC=${{matrix.archparams.cc}} CGO_ENABLED=1 GOOS=${{matrix.goos}} GOARCH=${{matrix.archparams.goarch}} go build -v client/main.go | |
- name: Build Server | |
run: env CC=${{matrix.archparams.cc}} CGO_ENABLED=1 GOOS=${{matrix.goos}} GOARCH=${{matrix.archparams.goarch}} go build -v server/main.go | |
- name: Test with the Go CLI | |
run: env CC=${{matrix.archparams.cc}} CGO_ENABLED=1 GOOS=${{matrix.goos}} GOARCH=${{matrix.archparams.goarch}} go run github.com/onsi/ginkgo/v2/ginkgo -r | |
build-macos: | |
strategy: | |
matrix: | |
go-version: [ '1.20.x', '1.21.x' ] | |
goos: [darwin] | |
goarch: [amd64,arm64] | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '${{matrix.go-version}}' | |
- name: Install dependencies | |
run: go get ./... | |
# No Build Server on MacOS right now as the server currently does no build on MacOS | |
- name: Build Client | |
run: env CGO_ENABLED=1 GOOS=${{matrix.goos}} GOARCH=${{matrix.goarch}} go build -v client/main.go | |
- name: Test with the Go CLI | |
run: env CGO_ENABLED=1 GOOS=${{matrix.goos}} GOARCH=${{matrix.goarch}} go run github.com/onsi/ginkgo/v2/ginkgo -r |