Skip to content

Commit 45e3a48

Browse files
author
Mustafa Elbehery
committed
chore(CI): Add QEMU to CI Workflow
Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
1 parent 092ee98 commit 45e3a48

1 file changed

Lines changed: 128 additions & 0 deletions

File tree

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
name: Cross-Platform Build Tests
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
build-aix:
12+
strategy:
13+
matrix:
14+
goarch: [ppc64]
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
- id: goversion
19+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
20+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
21+
with:
22+
go-version: ${{ steps.goversion.outputs.goversion }}
23+
24+
- name: Build for aix/${{ matrix.goarch }}
25+
run: |
26+
GOOS=aix GOARCH=${{ matrix.GOARCH }} go build ./...
27+
28+
build-android:
29+
strategy:
30+
matrix:
31+
goarch: [386, arm, arm64]
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35+
- id: goversion
36+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
37+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
38+
with:
39+
go-version: ${{ steps.goversion.outputs.goversion }}
40+
41+
- name: Install build dependencies
42+
run: sudo apt-get update && sudo apt-get install -y build-essential libc6-dev
43+
44+
- name: Install Android NDK
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get install -y wget unzip
48+
wget https://dl.google.com/android/repository/android-ndk-r26d-linux.zip
49+
unzip android-ndk-r26d-linux.zip
50+
echo "ANDROID_NDK_HOME=$PWD/android-ndk-r26d" >> $GITHUB_ENV
51+
echo "$PWD/android-ndk-r26d" >> $GITHUB_PATH
52+
53+
- name: Build for android/${{ matrix.goarch }}
54+
run: |
55+
export CGO_ENABLED=1
56+
export GOOS=android
57+
export GOARCH=${{ matrix.GOARCH }}
58+
export CGO_CFLAGS="--sysroot=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot"
59+
export CGO_LDFLAGS="--sysroot=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot"
60+
go build ./...
61+
62+
build-linux:
63+
strategy:
64+
matrix:
65+
goarch: [386, amd64, arm, arm64, loong64, mips, mips64, mips64le, mipsle, ppc64, ppc64le, riscv64, s390x]
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
69+
- id: goversion
70+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
71+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
72+
with:
73+
go-version: ${{ steps.goversion.outputs.goversion }}
74+
75+
- name: Build for linux/${{ matrix.goarch }}
76+
run: |
77+
GOOS=linux GOARCH=${{ matrix.GOARCH }} go build ./...
78+
79+
build-openbsd:
80+
strategy:
81+
matrix:
82+
goarch: [386, amd64, arm, arm64, ppc64, riscv64]
83+
runs-on: ubuntu-latest
84+
steps:
85+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
86+
- id: goversion
87+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
88+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
89+
with:
90+
go-version: ${{ steps.goversion.outputs.goversion }}
91+
92+
- name: Build for openbsd/${{ matrix.goarch }}
93+
run: |
94+
GOOS=openbsd GOARCH=${{ matrix.GOARCH }} go build ./...
95+
96+
build-solaris:
97+
strategy:
98+
matrix:
99+
goarch: [amd64]
100+
runs-on: ubuntu-latest
101+
steps:
102+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103+
- id: goversion
104+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
105+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
106+
with:
107+
go-version: ${{ steps.goversion.outputs.goversion }}
108+
109+
- name: Build for solaris/${{ matrix.goarch }}
110+
run: |
111+
GOOS=solaris GOARCH=${{ matrix.GOARCH }} go build ./...
112+
113+
build-windows:
114+
strategy:
115+
matrix:
116+
goarch: [386, amd64, arm64]
117+
runs-on: windows-latest
118+
steps:
119+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
120+
- id: goversion
121+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
122+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
123+
with:
124+
go-version: ${{ steps.goversion.outputs.goversion }}
125+
126+
- name: Build for windows/${{ matrix.goarch }}
127+
run: |
128+
$env:GOOS="windows"; $env:GOARCH="${{ matrix.GOARCH }}"; go build ./...

0 commit comments

Comments
 (0)