Skip to content

Commit 861da39

Browse files
committed
ci: Add NetBSD job
1 parent 470fc51 commit 861da39

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,66 @@ on:
55
pull_request:
66

77
jobs:
8+
build-netbsd:
9+
runs-on: ubuntu-latest
10+
name: build • netbsd ${{ matrix.release }}
11+
defaults:
12+
run:
13+
shell: netbsd {0}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
# Test all supported releases.
18+
# See https://www.netbsd.org/releases/.
19+
include:
20+
- release: 9.4
21+
capnproto-cppflags: 'CPPFLAGS="-DKJ_NO_EXCEPTIONS=0 -DKJ_USE_KQUEUE=0"'
22+
- release: 10.1
23+
capnproto-cppflags: 'CPPFLAGS="-DKJ_NO_EXCEPTIONS=0"'
24+
steps:
25+
- uses: actions/checkout@v6
26+
27+
- name: Start NetBSD VM
28+
uses: vmactions/netbsd-vm@v1
29+
with:
30+
release: ${{ matrix.release }}
31+
# The installed compiler version must match the CXX variable
32+
# defined in `ci/configs/netbsd.bash`.
33+
prepare: |
34+
pkg_add cmake ninja-build gcc14
35+
# capnproto prerequisites.
36+
# See the following "Install capnproto" step.
37+
run: |
38+
set -e
39+
pkg_add digest libtool-base mktools pkgconf cwrappers
40+
pkg_admin -K /usr/pkg/pkgdb fetch-pkg-vulnerabilities
41+
cd /usr
42+
cvs -danoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P \
43+
pkgsrc/devel/capnproto \
44+
pkgsrc/devel/libtool-base \
45+
pkgsrc/devel/pkgconf \
46+
pkgsrc/devel/zlib \
47+
`# gcc15 is referenced here because the pkgsrc framework requires lang/gcc15/version.mk to exist` \
48+
`# during the "make install" step below, even though we compile our project with gcc14.` \
49+
pkgsrc/lang/gcc15 \
50+
pkgsrc/mk \
51+
pkgsrc/pkgtools \
52+
pkgsrc/security/openssl \
53+
pkgsrc/sysutils/install-sh/files
54+
sync: 'rsync'
55+
copyback: false
56+
57+
- name: Install capnproto
58+
run: |
59+
cd /usr/pkgsrc/devel/capnproto/
60+
unset PKG_PATH
61+
make ${{ matrix.capnproto-cppflags }} install
62+
63+
- name: Run CI script
64+
run: |
65+
cd ${{ github.workspace }}
66+
CI_CONFIG="ci/configs/netbsd.bash" bash ci/scripts/ci.sh
67+
868
build-openbsd:
969
runs-on: ubuntu-latest
1070
name: build • openbsd

ci/configs/netbsd.bash

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CI_DESC="CI config for NetBSD"
2+
CI_DIR=build-netbsd
3+
export CXXFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter"
4+
# Hardcode GCC 14, since default GCC versions installed by NetBSD are older
5+
# and may not be compatible with libmultiprocess. GCC 14 was chosen because
6+
# it's the latest compiler available on all versions of NetBSD that we test.
7+
# Note that the GCC version specified here must match the version specified
8+
# in pkg_add in ci.yml.
9+
export CXX="/usr/pkg/gcc14/bin/g++"
10+
CMAKE_ARGS=(-G Ninja)
11+
BUILD_ARGS=(-k 0)

0 commit comments

Comments
 (0)