QEMU #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "QEMU" | |
on: | |
workflow_dispatch: | |
jobs: | |
qemu: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: arm64, i386 | |
- name: "Create an example binary for AArch64" | |
run: | | |
go mod init hello | |
cat << EOL > hello.go | |
package main | |
func main() { | |
println("Hello, AArch64!") | |
} | |
EOL | |
GOARCH=arm64 go build hello.go | |
- name: "This would fail without docker/setup-qemu-action" | |
run: ./hello | |
- name: "You can also run images from other platforms" | |
run: docker run --platform linux/i386 hello-world |