Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 1.07 KB

README.md

File metadata and controls

43 lines (28 loc) · 1.07 KB

Github Actions to Emulate CPU Architecture using QEMU

Sample application

Sample application is written in Go.

It only output GOOS and GOARCH. See main.go.

Binaries for target architecture is built by cross compile using GOARCH.

import "runtime"

func main() {
 println("GOOS :", runtime.GOOS)
 println("GOARCH :", runtime.GOARCH)
}

Action

Sample applications are run on Github runners as follows.

Installing QEMU.

Here, qemu-user which described at User Mode Emulation is used.

# Add repository to avoid much older qemu.
sudo add-apt-repository -y ppa:canonical-server/server-backports

sudo apt -y update
sudo apt -y install qemu-user

Running applications (Makefile is used).

See the QEMU User space emulator for available architectures.

GOARCH=arm GOARM=v7 go build
qemu-arm ./qemu-actions