Skip to content

Commit 0dcb047

Browse files
committed
chore(CI): Add QEMU to CI Workflow
Signed-off-by: Mustafa Elbehery <[email protected]>
1 parent 682819c commit 0dcb047

File tree

1 file changed

+135
-0
lines changed

1 file changed

+135
-0
lines changed
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
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+
- name: Run golangci-lint
24+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
25+
with:
26+
version: v2.1.6
27+
28+
- name: Build for aix/${{ matrix.goarch }}
29+
run: |
30+
GOOS=aix GOARCH=${{ matrix.GOARCH }} go build ./...
31+
32+
build-android:
33+
strategy:
34+
matrix:
35+
goarch: [arm64]
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
39+
- id: goversion
40+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
41+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
42+
with:
43+
go-version: ${{ steps.goversion.outputs.goversion }}
44+
- name: Run golangci-lint
45+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
46+
with:
47+
version: v2.1.6
48+
49+
- name: Build for android/${{ matrix.goarch }}
50+
run: |
51+
GOOS=android GOARCH=${{ matrix.goarch }} go build ./...
52+
53+
build-linux:
54+
strategy:
55+
matrix:
56+
goarch: [386, amd64, arm, arm64, loong64, mips, mips64, mips64le, mipsle, ppc64, ppc64le, riscv64, s390x]
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
60+
- id: goversion
61+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
62+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
63+
with:
64+
go-version: ${{ steps.goversion.outputs.goversion }}
65+
- name: Run golangci-lint
66+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
67+
with:
68+
version: v2.1.6
69+
70+
- name: Build for linux/${{ matrix.goarch }}
71+
run: |
72+
GOOS=linux GOARCH=${{ matrix.GOARCH }} go build ./...
73+
74+
build-openbsd:
75+
strategy:
76+
matrix:
77+
goarch: [386, amd64, arm, arm64, ppc64, riscv64]
78+
runs-on: ubuntu-latest
79+
steps:
80+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
81+
- id: goversion
82+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
83+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
84+
with:
85+
go-version: ${{ steps.goversion.outputs.goversion }}
86+
- name: Run golangci-lint
87+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
88+
with:
89+
version: v2.1.6
90+
91+
- name: Build for openbsd/${{ matrix.goarch }}
92+
run: |
93+
GOOS=openbsd GOARCH=${{ matrix.GOARCH }} go build ./...
94+
95+
build-solaris:
96+
strategy:
97+
matrix:
98+
goarch: [amd64]
99+
runs-on: ubuntu-latest
100+
steps:
101+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
102+
- id: goversion
103+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
104+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
105+
with:
106+
go-version: ${{ steps.goversion.outputs.goversion }}
107+
- name: Run golangci-lint
108+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
109+
with:
110+
version: v2.1.6
111+
112+
- name: Build for solaris/${{ matrix.goarch }}
113+
run: |
114+
GOOS=solaris GOARCH=${{ matrix.GOARCH }} go build ./...
115+
116+
build-windows:
117+
strategy:
118+
matrix:
119+
goarch: [386, amd64, arm64]
120+
runs-on: windows-latest
121+
steps:
122+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
123+
- id: goversion
124+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
125+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
126+
with:
127+
go-version: ${{ steps.goversion.outputs.goversion }}
128+
- name: Run golangci-lint
129+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
130+
with:
131+
version: v2.1.6
132+
133+
- name: Build for windows/${{ matrix.goarch }}
134+
run: |
135+
$env:GOOS="windows"; $env:GOARCH="${{ matrix.GOARCH }}"; go build ./...

0 commit comments

Comments
 (0)