From 7a03559d3ad519fedab20c7fb578bc935aa86256 Mon Sep 17 00:00:00 2001 From: The Tumultuous Unicorn Of Darkness Date: Fri, 2 Aug 2024 15:18:30 +0200 Subject: [PATCH] CI: add a build job for NetBSD --- .github/workflows/build_netbsd.yml | 57 ++++++++++++++++++++++++++++++ Readme.md | 2 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build_netbsd.yml diff --git a/.github/workflows/build_netbsd.yml b/.github/workflows/build_netbsd.yml new file mode 100644 index 0000000..be88feb --- /dev/null +++ b/.github/workflows/build_netbsd.yml @@ -0,0 +1,57 @@ +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/netbsd-vagrant-action@v2 + with: + box: ${{ matrix.box }} + save_box_to_cache: true + + - name: Install packages + run: sudo pkgin -y install clang cmake python311 + shell: /usr/local/bin/bash --noprofile --norc -euo pipefail {0} + + - name: Generate build system + run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="" -DLIBCPUID_ENABLE_TESTS=ON + shell: /usr/local/bin/bash --noprofile --norc -euo pipefail {0} + + - name: Build + run: cmake --build build + shell: /usr/local/bin/bash --noprofile --norc -euo pipefail {0} + + - name: Run cpuid_tool + run: | + sudo /sbin/sysctl -w security.models.extensions.user_set_cpu_affinity=1 + ./build/cpuid_tool/cpuid_tool --save=- --all + shell: /usr/local/bin/bash --noprofile --norc -euo pipefail {0} + + - name: Run tests + run: | + make -C build consistency + make -C build test-old + shell: /usr/local/bin/bash --noprofile --norc -euo pipefail {0} + + - name: Install + run: cmake --install build + env: + DESTDIR: ${{ github.workspace }}/installdir + shell: /usr/local/bin/bash --noprofile --norc -euo pipefail {0} diff --git a/Readme.md b/Readme.md index 6901906..c897d9c 100644 --- a/Readme.md +++ b/Readme.md @@ -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:|