-
Notifications
You must be signed in to change notification settings - Fork 11
221 lines (198 loc) · 6.37 KB
/
build.yml
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
---
on:
workflow_dispatch:
push:
paths-ignore:
- 'certdb/**'
- 'debian/**'
- 'demo/**'
- 'doc/**'
- 'js/**'
- 'prototypes/**'
- 'python/**'
- 'systemd/**'
- 'tools/**'
branches:
- master
pull_request:
paths-ignore:
- 'certdb/**'
- 'debian/**'
- 'demo/**'
- 'doc/**'
- 'js/**'
- 'prototypes/**'
- 'python/**'
- 'systemd/**'
- 'tools/**'
branches:
- master
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
runs-on: ubuntu-24.04
steps:
- id: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
meson \
ccache \
nlohmann-json3-dev \
libavahi-client-dev \
libbrotli-dev \
libcap-dev \
libcurl4-openssl-dev \
libdbus-1-dev \
libfmt-dev \
libgtest-dev \
libluajit-5.1-dev \
libnghttp2-dev \
libpcre2-dev \
libpq-dev \
libseccomp-dev \
libsodium-dev \
libssl-dev \
libsystemd-dev \
liburing-dev
- id: cache-ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{github.job}}
- name: Configure
run: |
meson setup \
-Dauto_features=enabled \
-Ddocumentation=disabled \
-Dcertdb=true \
--force-fallback-for=libcm4all-was-protocol,libcm4all-http \
-Dwrap_mode=nofallback \
output
- name: Build
run: ninja -C output -v
- name: Unit Tests
run: meson test -C output
- name: Dump Unit Test Log
if: ${{ failure() }}
continue-on-error: true
run: cat output/meson-logs/testlog.txt
mini:
runs-on: ubuntu-24.04
steps:
- id: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
meson \
ccache \
libfmt-dev \
libgtest-dev \
libpcre2-dev \
libsodium-dev \
libssl-dev
- id: cache-ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{github.job}}
- name: Configure
run: |
meson setup \
-Dauto_features=disabled \
-Dcertdb=false \
-Dwrap_mode=nofallback \
output
- name: Build
run: ninja -C output -v
- name: Unit Tests
run: meson test -C output
- name: Dump Unit Test Log
if: ${{ failure() }}
continue-on-error: true
run: cat output/meson-logs/testlog.txt
certdb:
runs-on: ubuntu-24.04
steps:
- id: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
meson \
ccache \
nlohmann-json3-dev \
libfmt-dev \
libsystemd-dev libdbus-1-dev \
libcurl4-openssl-dev \
libgtest-dev \
libpcre2-dev \
libsodium-dev \
libssl-dev \
libpq-dev \
pebble
- id: cache-ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{github.job}}
- name: Configure
run: |
meson setup \
-Dauto_features=disabled \
-Dsystemd=enabled \
-Dcertdb=true \
-Dwrap_mode=nofallback \
output
- name: Build
run: ninja -C output -v cm4all-certdb cm4all-beng-lb test/acme/pebble-cert.pem
- name: Set up certdb
run: |
sudo systemctl start postgresql.service
pg_isready
sudo -u postgres createuser runner
sudo -u postgres createuser cm4all-beng-lb
sudo -u postgres createdb certdb
sudo -u postgres psql certdb <certdb/certdb.sql
sudo -u postgres psql certdb <certdb/acme_account.sql
sudo -u postgres psql certdb --command='GRANT SELECT,INSERT,UPDATE,DELETE ON ALL TABLES IN SCHEMA public TO runner'
sudo -u postgres psql certdb --command='GRANT UPDATE,SELECT ON server_certificate_id_seq TO runner'
sudo -u postgres psql certdb --command='GRANT UPDATE,SELECT ON server_certificate_alt_name_id_seq TO runner'
sudo -u postgres psql certdb --command='GRANT UPDATE,SELECT ON acme_account_id_seq TO runner'
sudo -u postgres psql certdb --command='GRANT SELECT ON server_certificate, server_certificate_alt_name TO "cm4all-beng-lb"'
- name: Start beng-lb
run: |
sudo mkdir -vp /etc/cm4all/beng/lb /usr/lib/cm4all/beng-lb/systemd
sudo cp -v test/acme/lb.conf /etc/cm4all/beng/
sudo cp -v output/test/acme/ca-cert.pem /etc/cm4all/beng/lb/ca.pem
sudo cp -v output/test/acme/pebble-cert.pem /etc/cm4all/beng/lb/cert.pem
sudo cp -v output/test/acme/pebble-key.pem /etc/cm4all/beng/lb/key.pem
sudo cp -v systemd/lb/run.sh /usr/lib/cm4all/beng-lb/systemd/
sudo cp -v debian/cm4all-beng-lb.sysusers /lib/sysusers.d/cm4all-beng-lb.conf
sudo cp -v debian/cm4all-beng-lb.service /etc/systemd/system/
sudo cp -v output/cm4all-beng-lb /usr/sbin/
sudo systemd-sysusers
sudo systemctl daemon-reload
sudo systemctl start cm4all-beng-lb
- name: Test ACME client
run: |
set -x
pebble -strict -config output/test/acme/pebble-config.json &
sleep 1
sudo mkdir -vp /etc/cm4all/beng
sudo cp -v test/acme/certdb.conf /etc/cm4all/beng/
ACME="./output/cm4all-certdb acme --debug --tls-ca output/test/acme/ca-cert.pem --directory-url https://0.0.0.0:14000/dir --account-db --alpn"
$ACME new-account [email protected]
$ACME new-order foo localhost
$ACME renew-cert foo
./output/cm4all-certdb tail
./output/cm4all-certdb get foo