-
Notifications
You must be signed in to change notification settings - Fork 42
183 lines (159 loc) · 5.51 KB
/
ci.yml
File metadata and controls
183 lines (159 loc) · 5.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: CI
on:
push:
pull_request:
jobs:
build-netbsd:
runs-on: ubuntu-latest
name: build • netbsd ${{ matrix.release }}
defaults:
run:
shell: netbsd {0}
strategy:
fail-fast: false
matrix:
# Test all supported releases.
# See https://www.netbsd.org/releases/.
include:
- release: 9.4
capnproto-cppflags: 'CPPFLAGS="-DKJ_NO_EXCEPTIONS=0 -DKJ_USE_KQUEUE=0"'
- release: 10.1
capnproto-cppflags: 'CPPFLAGS="-DKJ_NO_EXCEPTIONS=0"'
steps:
- uses: actions/checkout@v6
- name: Start NetBSD VM
uses: vmactions/netbsd-vm@v1
with:
release: ${{ matrix.release }}
# The installed compiler version must match the CXX variable
# defined in `ci/configs/netbsd.bash`.
prepare: |
pkg_add cmake ninja-build gcc14
# capnproto prerequisites.
# See the following "Install capnproto" step.
run: |
set -e
pkg_add digest libtool-base mktools pkgconf cwrappers
pkg_admin -K /usr/pkg/pkgdb fetch-pkg-vulnerabilities
cd /usr
cvs -danoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P \
pkgsrc/devel/capnproto \
pkgsrc/devel/libtool-base \
pkgsrc/devel/pkgconf \
pkgsrc/devel/zlib \
`# gcc15 is referenced here because the pkgsrc framework requires lang/gcc15/version.mk to exist` \
`# during the "make install" step below, even though we compile our project with gcc14.` \
pkgsrc/lang/gcc15 \
pkgsrc/mk \
pkgsrc/pkgtools \
pkgsrc/security/openssl \
pkgsrc/sysutils/install-sh/files
sync: 'rsync'
copyback: false
- name: Install capnproto
run: |
cd /usr/pkgsrc/devel/capnproto/
unset PKG_PATH
make ${{ matrix.capnproto-cppflags }} install
- name: Run CI script
run: |
cd ${{ github.workspace }}
CI_CONFIG="ci/configs/netbsd.bash" bash ci/scripts/ci.sh
build-openbsd:
runs-on: ubuntu-latest
name: build • openbsd
defaults:
run:
shell: openbsd {0}
steps:
- uses: actions/checkout@v5
- name: Start OpenBSD VM
uses: vmactions/openbsd-vm@v1
with:
prepare: |
pkg_add -v cmake ninja bash capnproto
sync: 'rsync'
copyback: false
- name: Run CI script
run: |
cd ${{ github.workspace }}
CI_CONFIG="ci/configs/openbsd.bash" bash ci/scripts/ci.sh
build-freebsd:
runs-on: ubuntu-latest
name: build • freebsd
defaults:
run:
shell: freebsd {0}
steps:
- uses: actions/checkout@v5
- name: Start FreeBSD VM
uses: vmactions/freebsd-vm@v1
with:
prepare: |
pkg install -y cmake ninja bash capnproto
sync: 'rsync'
copyback: false
- name: Run CI script
run: |
cd ${{ github.workspace }}
CI_CONFIG="ci/configs/freebsd.bash" bash ci/scripts/ci.sh
build-macos:
runs-on: macos-latest
name: build • macos
steps:
- uses: actions/checkout@v5
- name: Install dependencies
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
run: |
brew install --quiet ninja capnp llvm
- name: Run CI script
run: |
export PATH="$(brew --prefix llvm)/bin:$PATH"
CI_CONFIG="ci/configs/macos.bash" bash ci/scripts/ci.sh
build:
runs-on: ubuntu-latest
env:
NIXPKGS_CHANNEL: nixos-25.05
NIX_EXTRA_CONFIG: |
keep-env-derivations = true
keep-outputs = true
NIX_EXTRA_CONFIG_ACT: |
sandbox = false
filter-syscalls = false
strategy:
fail-fast: false
matrix:
config: [default, llvm, gnu32, sanitize, olddeps]
name: build • ${{ matrix.config }}
steps:
- uses: actions/checkout@v5
- name: Determine CI configuration
id: config
env:
CI_CONFIG: ci/configs/${{ matrix.config }}.bash
run: ci/scripts/config.sh
- name: Install Nix
uses: cachix/install-nix-action@v31 # 2025-05-27, from https://github.com/cachix/install-nix-action/tags
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/${{ steps.config.outputs.nixpkgs_rev }}.tar.gz
# Act executes inside an unprivileged container (Docker or Podman),
# so KVM support isn't available.
enable_kvm: "${{ github.actor != 'nektos/act' }}"
extra_nix_config: |
${{ env.NIX_EXTRA_CONFIG }}
${{ github.actor == 'nektos/act' && env.NIX_EXTRA_CONFIG_ACT || '' }}
- name: Cache Nix store
if: steps.config.outputs.cache_nix_store == 'true'
uses: nix-community/cache-nix-action@v7
with:
primary-key: nix-${{ runner.os }}-${{ matrix.config }}-${{ steps.config.outputs.nixpkgs_rev }}-${{ hashFiles('shell.nix', 'ci/patches/*.patch', format('ci/configs/{0}.bash', matrix.config)) }}
restore-prefixes-first-match: |
nix-${{ runner.os }}-${{ matrix.config }}-${{ steps.config.outputs.nixpkgs_rev }}-
nix-${{ runner.os }}-${{ matrix.config }}-
nix-${{ runner.os }}-
gc-max-store-size-linux: 10G
- name: Run CI script
env:
CI_CONFIG: ci/configs/${{ matrix.config }}.bash
run: ci/scripts/run.sh