Skip to content

Commit

Permalink
Add qemu-based multiarch build/test CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ogxd committed Dec 24, 2023
1 parent 2c7036d commit 9e83f6d
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/qemu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Cross-Architecture Test

on: [push, pull_request]

jobs:
test:
strategy:
matrix:
include:
- arch: amd64
qemu_arch: x86_64
- arch: arm64v8
qemu_arch: aarch64
- arch: i386
qemu_arch: i386

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: ${{ matrix.qemu_arch }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}

- name: Run cargo test
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp ${{ matrix.arch }}/rust cargo test

0 comments on commit 9e83f6d

Please sign in to comment.