Skip to content

Commit

Permalink
Add build for arm 32 bits
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
  • Loading branch information
ajnavarro committed Dec 17, 2021
1 parent 1a59d03 commit 3c3aaac
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 10 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build-32.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: build-32

# Trigger the workflow on push or pull request
on:
push:
branches:
- '*'
tags:
- '*'
pull_request:

jobs:
armv7_job:
# The host should always be Linux
runs-on: ubuntu-20.04
name: ubuntu-20.04 armv7
steps:
- uses: actions/checkout@v2
name: Checkout
with:
fetch-depth: 0
- uses: uraimo/run-on-arch-action@v2.0.5
name: Test and Build
id: runcmd
with:
arch: armv7
distro: ubuntu20.04
githubToken: ${{ github.token }}

setup: |
mkdir -p "${PWD}/bin"
dockerRunArgs: |
--volume "${PWD}/bin:/bin"
install: |
apt update
apt install -y fuse libfuse-dev rpm pkg-config curl
apt upgrade -y
export PATH=$PATH:/usr/local/go/bin
rm -rf /usr/local/go
mkdir -p /usr/local/go
curl -s -L https://golang.org/dl/go1.17.linux-armv6l.tar.gz | tar -C /usr/local -xz
go version
run: |
echo "Produced artifact at /artifacts/${artifact_name}"
11 changes: 3 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,14 @@ jobs:
include:
- job_name: linux
os: ubuntu-latest
go: '1.17.x'

- job_name: mac
os: macOS-latest
go: '1.17.x'

- job_name: windows_amd64
os: windows-latest
go: '1.17.x'
cgo: '0'

name: ${{ matrix.job_name }}
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -43,9 +40,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
stable: 'false'
go-version: ${{ matrix.go }}

go-version: ^1.17
- name: Set environment variables
shell: bash
run: |
Expand Down Expand Up @@ -104,7 +99,7 @@ jobs:
- name: Run tests
shell: bash
run: |
make test
make test-race
- name: Convert coverage.out to coverage.lcov
uses: jandelgado/gcov2lcov-action@v1.0.8
if: matrix.os == 'ubuntu-latest'
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ run:
## build: build binary.
build: go-generate go-build

## test: execute all tests.
test:
## test-race: execute all tests with race enabled.
test-race:
CGO_ENABLED=1 go test -v --race -coverprofile=coverage.out ./...

## test: execute all tests
test:
CGO_ENABLED=1 go test -v -coverprofile=coverage.out ./...

## cross-compile: compile for other platforms using xgo.
cross-compile: go-generate go-cross-compile

Expand Down

0 comments on commit 3c3aaac

Please sign in to comment.