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.
This commit is contained in:
Romain Malmain 2024-03-14 13:55:52 +01:00 committed by GitHub
parent f282d6aef5
commit 131dca34d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 32 additions and 0 deletions

8
.github/setup_self_hosted/README.md vendored Normal file
View File

@ -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`

8
.github/setup_self_hosted/ubuntu.sh vendored Normal file
View File

@ -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

16
.github/workflows/build_and_test.yaml vendored Normal file
View File

@ -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)