From 6fd916818c05b9129fa0a27df5a5e2de4aa24951 Mon Sep 17 00:00:00 2001 From: Mustafa Elbehery Date: Thu, 12 Jun 2025 14:00:04 +0200 Subject: [PATCH] chore(CI): Add QEMU to CI Workflow Signed-off-by: Mustafa Elbehery --- .github/workflows/cross-arch-test.yaml | 135 +++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 .github/workflows/cross-arch-test.yaml diff --git a/.github/workflows/cross-arch-test.yaml b/.github/workflows/cross-arch-test.yaml new file mode 100644 index 000000000..197b259df --- /dev/null +++ b/.github/workflows/cross-arch-test.yaml @@ -0,0 +1,135 @@ +--- +name: Cross-Platform Build Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build-aix: + strategy: + matrix: + goarch: [ppc64] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version: ${{ steps.goversion.outputs.goversion }} + - name: Run golangci-lint + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 + with: + version: v2.1.6 + + - name: Build for aix/${{ matrix.goarch }} + run: | + GOOS=aix GOARCH=${{ matrix.GOARCH }} go build ./... + + build-android: + strategy: + matrix: + goarch: [arm64] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version: ${{ steps.goversion.outputs.goversion }} + - name: Run golangci-lint + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 + with: + version: v2.1.6 + + - name: Build for android/${{ matrix.goarch }} + run: | + GOOS=android GOARCH=${{ matrix.goarch }} go build ./... + + build-linux: + strategy: + matrix: + goarch: [386, amd64, arm, arm64, loong64, mips, mips64, mips64le, mipsle, ppc64, ppc64le, riscv64, s390x] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version: ${{ steps.goversion.outputs.goversion }} + - name: Run golangci-lint + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 + with: + version: v2.1.6 + + - name: Build for linux/${{ matrix.goarch }} + run: | + GOOS=linux GOARCH=${{ matrix.GOARCH }} go build ./... + + build-openbsd: + strategy: + matrix: + goarch: [386, amd64, arm, arm64, ppc64, riscv64] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version: ${{ steps.goversion.outputs.goversion }} + - name: Run golangci-lint + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 + with: + version: v2.1.6 + + - name: Build for openbsd/${{ matrix.goarch }} + run: | + GOOS=openbsd GOARCH=${{ matrix.GOARCH }} go build ./... + + build-solaris: + strategy: + matrix: + goarch: [amd64] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version: ${{ steps.goversion.outputs.goversion }} + - name: Run golangci-lint + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 + with: + version: v2.1.6 + + - name: Build for solaris/${{ matrix.goarch }} + run: | + GOOS=solaris GOARCH=${{ matrix.GOARCH }} go build ./... + + build-windows: + strategy: + matrix: + goarch: [386, amd64, arm64] + runs-on: windows-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" + - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version: ${{ steps.goversion.outputs.goversion }} + - name: Run golangci-lint + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 + with: + version: v2.1.6 + + - name: Build for windows/${{ matrix.goarch }} + run: | + $env:GOOS="windows"; $env:GOARCH="${{ matrix.GOARCH }}"; go build ./...