ci.yml
  1  name: CI
  2  
  3  on:
  4    push:
  5    pull_request:
  6  
  7  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  
 68    build-openbsd:
 69      runs-on: ubuntu-latest
 70      name: build • openbsd
 71      defaults:
 72        run:
 73          shell: openbsd {0}
 74      steps:
 75        - uses: actions/checkout@v5
 76  
 77        - name: Start OpenBSD VM
 78          uses: vmactions/openbsd-vm@v1
 79          with:
 80            prepare: |
 81              pkg_add -v cmake ninja bash capnproto
 82            sync: 'rsync'
 83            copyback: false
 84  
 85        - name: Run CI script
 86          run: |
 87            cd ${{ github.workspace }}
 88            CI_CONFIG="ci/configs/openbsd.bash" bash ci/scripts/ci.sh
 89  
 90    build-freebsd:
 91      runs-on: ubuntu-latest
 92      name: build • freebsd
 93      defaults:
 94        run:
 95          shell: freebsd {0}
 96      steps:
 97        - uses: actions/checkout@v5
 98  
 99        - name: Start FreeBSD VM
100          uses: vmactions/freebsd-vm@v1
101          with:
102            prepare: |
103              pkg install -y cmake ninja bash capnproto
104            sync: 'rsync'
105            copyback: false
106  
107        - name: Run CI script
108          run: |
109            cd ${{ github.workspace }}
110            CI_CONFIG="ci/configs/freebsd.bash" bash ci/scripts/ci.sh
111  
112    build-macos:
113      runs-on: macos-latest
114      name: build • macos
115  
116      steps:
117        - uses: actions/checkout@v5
118  
119        - name: Install dependencies
120          env:
121            HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
122          run: |
123            brew install --quiet ninja capnp
124  
125        - name: Run CI script
126          run: |
127            CI_CONFIG="ci/configs/macos.bash" bash ci/scripts/ci.sh
128  
129    build:
130      runs-on: ubuntu-latest
131  
132      env:
133        NIX_EXTRA_CONFIG_ACT: |
134          sandbox = false
135          filter-syscalls = false
136  
137      strategy:
138        fail-fast: false
139        matrix:
140          config: [default, llvm, gnu32, sanitize, olddeps]
141  
142      name: build • ${{ matrix.config }}
143  
144      steps:
145        - uses: actions/checkout@v5
146  
147        - name: Install Nix
148          uses: cachix/install-nix-action@v31       # 2025-05-27, from https://github.com/cachix/install-nix-action/tags
149          with:
150            nix_path: nixpkgs=channel:nixos-25.05   # latest release
151            # Act executes inside an unprivileged container (Docker or Podman),
152            # so KVM support isn't available.
153            enable_kvm: "${{ github.actor != 'nektos/act' }}"
154            extra_nix_config: ${{ github.actor == 'nektos/act' && env.NIX_EXTRA_CONFIG_ACT || '' }}
155  
156        - name: Run CI script
157          env:
158            CI_CONFIG: ci/configs/${{ matrix.config }}.bash
159          run: ci/scripts/run.sh