Skip to content

Commit

Permalink
CI: add a build job for NetBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTumultuousUnicornOfDarkness committed Aug 2, 2024
1 parent 6a189f5 commit 2970a9f
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
62 changes: 62 additions & 0 deletions .github/workflows/build_netbsd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build (NetBSD)

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
build_netbsd:
name: Build on ${{ matrix.box }}
runs-on: ubuntu-latest
strategy:
matrix:
box:
- generic/netbsd9
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Provision VM
uses: hummeltech/vagrant-action@v1
with:
box: ${{ matrix.box }}
save_box_to_cache: true
provision_commands: >-
. /etc/profile
echo $PATH
set -x;
pkgin update;
pkgin -y upgrade;
pkgin -y install rsync;
echo 'AcceptEnv *' >> /etc/ssh/sshd_config;
service sshd restart;
mkdir -p ${{ github.workspace }};
chown vagrant:vagrant ${{ github.workspace }};
mkdir -p ${{ runner.temp }};
chown vagrant:vagrant ${{ runner.temp }};
- name: Install packages
run: sudo pkgin -y install clang cmake python311

- name: Generate build system
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="" -DLIBCPUID_ENABLE_TESTS=ON

- name: Build
run: cmake --build build

- name: Run cpuid_tool
run: ./build/cpuid_tool/cpuid_tool --save=- --all

- name: Run tests
run: |
make -C build consistency
make -C build test-old
- name: Install
run: cmake --install build
env:
DESTDIR: ${{ github.workspace }}/installdir
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ libcpuid support varies depending on the features:
|FreeBSD|:heavy_check_mark: ![FreeBSD workflow status](https://github.com/anrieff/libcpuid/actions/workflows/build_freebsd.yml/badge.svg)|:heavy_check_mark: ([`cpuctl` kernel module](https://man.freebsd.org/cgi/man.cgi?query=cpuctl))|:heavy_check_mark:¹ ([`cpuid` out-of-tree kernel module](https://github.com/anrieff/libcpuid/tree/master/drivers/arm/freebsd))|
|Linux|:heavy_check_mark: ![Linux workflow status](https://github.com/anrieff/libcpuid/actions/workflows/build_linux.yml/badge.svg)|:heavy_check_mark: ([`msr` kernel module](https://man7.org/linux/man-pages/man4/msr.4.html))|:heavy_check_mark:¹ ([`cpuid` out-of-tree kernel module](https://github.com/anrieff/libcpuid/tree/master/drivers/arm/linux))|
|macOS|:heavy_check_mark: ![macOS workflow status](https://github.com/anrieff/libcpuid/actions/workflows/build_macos.yml/badge.svg)|:x:|:x:|
|NetBSD|:grey_question:|:x:|:x:|
|NetBSD|:heavy_check_mark: ![NetBSD BSD workflow status](https://github.com/anrieff/libcpuid/actions/workflows/build_netbsd.yml/badge.svg)|:x:|:x:|
|OpenBSD|:heavy_check_mark: ![OpenBSD BSD workflow status](https://github.com/anrieff/libcpuid/actions/workflows/build_openbsd.yml/badge.svg)|:x:|:x:|
|Windows|:heavy_check_mark: ![Windows workflow status](https://github.com/anrieff/libcpuid/actions/workflows/build_windows.yml/badge.svg)|:heavy_check_mark: ([`msr` driver](https://github.com/anrieff/libcpuid/tree/master/drivers/x86/windows/msr))|:x:|

Expand Down

0 comments on commit 2970a9f

Please sign in to comment.