-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ramkumar Chinchani <[email protected]>
- Loading branch information
Showing
1 changed file
with
43 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,11 +91,53 @@ jobs: | |
privilege-level: ${{fromJson(inputs.privilege-level)}} | ||
build-id: ${{fromJson(inputs.build-id)}} | ||
arch: ["aarch64"] | ||
name: "golang ${{ matrix.go-version }} privilege ${{ matrix.privilege-level }}" | ||
name: "${{ matrix.arch }}/golang ${{ matrix.go-version }} privilege ${{ matrix.privilege-level }}" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: benjlevesque/[email protected] | ||
id: short-sha | ||
- name: qemu-${{ matrix.arch }} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get -y install qemu-system-arm qemu-efi-aarch64 qemu-utils cloud-image-utils sshpass | ||
curl -Lo cloud.img https://cloud-images.ubuntu.com/releases/lunar/release/ubuntu-23.04-server-cloudimg-arm64.img | ||
# cloud-config | ||
cat > metadata.yaml <<EOF | ||
instance-id: qemu-arm64 | ||
local-hostname: qemu-arm64 | ||
EOF | ||
#cloud-config | ||
cat > user-data.yaml <<EOF | ||
users: | ||
- name: ubuntu | ||
shell: /bin/bash | ||
sudo: ['ALL=(ALL) NOPASSWD:ALL'] | ||
ssh_pwauth: True ## This line enables ssh password authentication | ||
chpasswd: | ||
list: | | ||
ubuntu:ubuntu ## Overriding default username, password | ||
EOF | ||
cloud-localds seed.img user-data.yaml metadata.yaml | ||
qemu-system-${{ matrix.arch }} \ | ||
-daemonize \ | ||
-display none \ | ||
-M virt -cpu max \ | ||
-bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd \ | ||
-m 2G \ | ||
-device virtio-net-pci,netdev=net0 \ | ||
-netdev user,id=net0,hostfwd=tcp::2222-:22 \ | ||
-drive if=virtio,format=qcow2,file=cloud.img \ | ||
-drive if=virtio,format=raw,file=seed.img | ||
# wait until ready | ||
echo "Waiting for ssh to be ready ..." | ||
while true; do | ||
x=$(ssh-keyscan -v -p 2222 localhost) || true | ||
if ["x"$x != "x" ]; then | ||
break | ||
fi | ||
sleep 5 | ||
done | ||
sshpass -p ubuntu ssh -o "StrictHostKeyChecking no" -p 2222 ubuntu@localhost "uname -rsa" | ||
- uses: uraimo/run-on-arch-action@v2 | ||
name: Build for ${{ matrix.arch }} | ||
id: runcmd | ||
|