Skip to content

Create netbsd.yml

Create netbsd.yml #1

Workflow file for this run

name: NetBSD CI
on:
push:
branches: [ main, adaptiveDt ]
pull_request:
branches: [ main ]
jobs:
netbsd:
name: NetBSD 10.0 Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install QEMU
run: |
sudo apt-get update
sudo apt-get install -y qemu-system-x86 qemu-utils
- name: Download preinstalled NetBSD image
run: |
wget https://cdn.netbsd.org/pub/NetBSD/images/10.0/NetBSD-10.0-amd64.qcow2.gz
gunzip NetBSD-10.0-amd64.qcow2.gz
mv NetBSD-10.0-amd64.qcow2 netbsd.qcow2
- name: Start NetBSD VM
run: |
qemu-system-x86_64 \
-m 2G \
-drive file=netbsd.qcow2,format=qcow2 \
-nic user,hostfwd=tcp::2222-:22 \
-nographic &
sleep 20
- name: Install dependencies inside NetBSD
run: |
ssh -o StrictHostKeyChecking=no -p 2222 root@localhost "
pkgin -y update &&
pkgin -y install clang libomp cmake gmake hdf5
"
- name: Copy source into VM
run: |
scp -P 2222 -o StrictHostKeyChecking=no -r . root@localhost:/root/src
- name: Build inside NetBSD
run: |
ssh -p 2222 -o StrictHostKeyChecking=no root@localhost "
cd /root/src &&
export CC=clang &&
export CXX=clang++ &&
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release &&
cmake --build build -- -j4 &&
cd build &&
ctest --output-on-failure
"