Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- '**.md'
- 'www/**'
- 'app/**'
pull_request:
workflow_dispatch:
inputs:
img:
Expand All @@ -33,6 +34,7 @@ on:

jobs:
build_img:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
container:
image: debian:latest
Expand Down Expand Up @@ -77,3 +79,58 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

smoler_registry_test:
runs-on: ubuntu-latest
env:
QEMU_ACCEL: tcg
services:
registry:
image: registry:2
ports:
- 5000:5000
env:
REGISTRY_STORAGE: inmemory
options: >-
--health-cmd "wget --quiet --spider http://127.0.0.1:5000/v2/ || exit 1"
--health-interval 5s
--health-timeout 3s
--health-retries 20
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
bmake \
curl \
gdisk \
jq \
libarchive-tools \
qemu-system-x86 \
rsync \
socat

- name: Build Dockerfiles with smoler
run: |
for dockerfile in dockerfiles/Dockerfile.*; do
echo "Building ${dockerfile}"
./smoler.sh build -y "${dockerfile}"
done

- name: Push and pull image through in-memory registry
env:
SMOLREPO: localhost:5000/smolbsd
ORAS_PLAIN_HTTP: "true"
run: |
image="images/basic-amd64:latest.img"
test -f "${image}"

./smoler.sh push "${image}"

rm -f "${image}"
./smoler.sh pull basic-amd64:latest

test -f "${image}"

22 changes: 18 additions & 4 deletions startnb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,29 @@ fi

cputype="host"

# allow forcing a specific accelerator (for CI or restricted hosts)
if [ -n "${QEMU_ACCEL}" ]; then
accel="-accel ${QEMU_ACCEL}"
[ "${QEMU_ACCEL}" = "tcg" ] && cputype="qemu64"
fi

case $OS in
NetBSD)
accel="-accel nvmm"
[ -z "$accel" ] && accel="-accel nvmm"
;;
Linux)
accel="-accel kvm"
if [ -z "$accel" ]; then
if [ -c /dev/kvm ] && [ -r /dev/kvm ] && [ -w /dev/kvm ]; then
accel="-accel kvm"
else
accel="-accel tcg"
cputype="qemu64"
echo "${WARN} KVM unavailable, falling back to TCG"
fi
fi
;;
Darwin)
accel="-accel hvf"
[ -z "$accel" ] && accel="-accel hvf"
if [ "$arch" = "evbarm-aarch64" ]; then
# Mac M1, M2, M3, M4
cputype="cortex-a57"
Expand All @@ -150,7 +164,7 @@ Darwin)
fi
;;
OpenBSD|FreeBSD)
accel="-accel tcg" # unaccelerated
[ -z "$accel" ] && accel="-accel tcg" # unaccelerated
cputype="qemu64"
;;
*)
Expand Down
Loading