From 131dca34d4cd3e5f5edd3994c9fbdb58f22e2987 Mon Sep 17 00:00:00 2001 From: Romain Malmain Date: Thu, 14 Mar 2024 13:55:52 +0100 Subject: [PATCH] Create Github actions (#51) * initial workflow * fix: wrong container path. * fix: build run command. * test: list directory. * test: list directory. * fix: add checkout action. * add setup scripts and instructions. --- .github/setup_self_hosted/README.md | 8 ++++++++ .github/setup_self_hosted/ubuntu.sh | 8 ++++++++ .github/workflows/build_and_test.yaml | 16 ++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 .github/setup_self_hosted/README.md create mode 100644 .github/setup_self_hosted/ubuntu.sh create mode 100644 .github/workflows/build_and_test.yaml diff --git a/.github/setup_self_hosted/README.md b/.github/setup_self_hosted/README.md new file mode 100644 index 0000000000..5fee8410fc --- /dev/null +++ b/.github/setup_self_hosted/README.md @@ -0,0 +1,8 @@ +# Setup self-hosted GitHub runners + +Instructions to set up self-hosted GitHub runners. + +- Setup the desired machine. +- Create the runner by following the instructions in `Settings > Actions > Runners > New self-hosted runner`. +- Run the setup script according to your OS from this directory. +- (Optional - Linux) run `svc.sh` to make the runner work with `systemd`: `sudo ./svc.sh install && sudo ./svc.sh start` diff --git a/.github/setup_self_hosted/ubuntu.sh b/.github/setup_self_hosted/ubuntu.sh new file mode 100644 index 0000000000..8095d8cc2b --- /dev/null +++ b/.github/setup_self_hosted/ubuntu.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Should be run as root + +apt -y update && apt -y upgrade +apt -y install docker.io + +usermod -aG docker $USER diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml new file mode 100644 index 0000000000..0c6ea842bb --- /dev/null +++ b/.github/workflows/build_and_test.yaml @@ -0,0 +1,16 @@ +name: Build and Test QEMU + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: self-hosted + container: registry.gitlab.com/qemu-project/qemu/qemu/ubuntu2204:latest + steps: + - uses: actions/checkout@v4 + - name: Build QEMU + run: mkdir -p build && cd build && ../configure --enable-werror --disable-docs --enable-fdt=system && make -j $(expr $(nproc) + 1)