Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linux arm targets #7

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 40 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,32 @@ jobs:
runs-on: ubuntu-22.04
needs:
- test-linux
strategy:
matrix:
target: [ amd64, arm64, arm ]
include:
- target: amd64
CGO_ENABLED: 1
GOARCH: amd64
CC: gcc
- target: arm64
CGO_ENABLED: 1
GOARCH: arm64
CC: /usr/local/gcc-linaro-4.8-2015.06-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc
toolchain_source: https://releases.linaro.org/archive/15.06/components/toolchain/binaries/4.8/aarch64-linux-gnu/gcc-linaro-4.8-2015.06-x86_64_aarch64-linux-gnu.tar.xz
toolchain_extract: sudo tar -xf gcc-linaro-4.8-2015.06-x86_64_aarch64-linux-gnu.tar.xz -C /usr/local
- target: arm
CGO_ENABLED: 1
GOARCH: arm
CC: /usr/local/gcc-linaro-4.8-2015.06-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc
toolchain_source: https://releases.linaro.org/archive/15.06/components/toolchain/binaries/4.8/arm-linux-gnueabi/gcc-linaro-4.8-2015.06-x86_64_arm-linux-gnueabi.tar.xz
toolchain_extract: sudo tar -xf gcc-linaro-4.8-2015.06-x86_64_arm-linux-gnueabi.tar.xz -C /usr/local
env:
CGO_ENABLED: ${{ matrix.CGO_ENABLED }}
GOOS: linux
GOARCH: ${{ matrix.GOARCH }}
CC: ${{ matrix.CC }}
name: build-linux-${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
Expand All @@ -96,12 +122,16 @@ jobs:
with:
name: grpc
path: pkg/a2l
- if: ${{ matrix.CC != 'gcc' }}
run: |
wget ${{ matrix.toolchain_source }}
${{ matrix.toolchain_extract }}
- run: |
go get github.com/antlr4-go/antlr/v4
go build --buildmode=c-shared -o a2l_grpc_$(go env GOOS)_$(go env GOARCH).so ./cmd/a2l/a2l.go
- uses: actions/upload-artifact@v4
with:
name: linux
name: linux_${{ matrix.target }}
path: |
*.so
*.h
Expand Down Expand Up @@ -199,7 +229,15 @@ jobs:
- run: mkdir a2l_grpc
- uses: actions/download-artifact@v4
with:
name: linux
name: linux_amd64
path: a2l_grpc
- uses: actions/download-artifact@v4
with:
name: linux_arm64
path: a2l_grpc
- uses: actions/download-artifact@v4
with:
name: linux_arm
path: a2l_grpc
- uses: actions/download-artifact@v4
with:
Expand Down