Skip to content

Commit da00c6d

Browse files
authored
Merge pull request #3529 from Easton97-Jens/v3/master_update_workflows
ci: update workflows (checkout v6, recursive submodules), prep for mbedTLS v4, Windows fixes
2 parents ad8b8a8 + cfa0bcd commit da00c6d

File tree

2 files changed

+132
-34
lines changed

2 files changed

+132
-34
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ name: Quality Assurance
33
on:
44
push:
55
pull_request:
6-
6+
77
jobs:
88
build-linux:
99
name: Linux (${{ matrix.platform.label }}, ${{ matrix.compiler.label }}, ${{ matrix.configure.label }})
1010
runs-on: ${{ matrix.os }}
1111
strategy:
12+
fail-fast: false
1213
matrix:
1314
os: [ubuntu-22.04]
1415
platform:
@@ -33,18 +34,49 @@ jobs:
3334
- platform: {label: "x32"}
3435
configure: {label: "wo ssdeep"}
3536
steps:
37+
- name: Detect latest Lua dev package
38+
id: detect_lua
39+
shell: bash
40+
run: |
41+
set -euo pipefail
42+
43+
sudo apt-get update -y -qq
44+
45+
CANDIDATES="$(apt-cache pkgnames | grep -E '^liblua[0-9]+\.[0-9]+-dev$' || true)"
46+
47+
if [ -z "$CANDIDATES" ]; then
48+
echo "No libluaX.Y-dev package found"
49+
exit 1
50+
fi
51+
52+
BEST_PKG="$(
53+
printf '%s\n' "$CANDIDATES" \
54+
| sed -E 's/^liblua([0-9]+\.[0-9]+)-dev$/\1 &/' \
55+
| sort -V \
56+
| tail -n1 \
57+
| awk '{print $2}'
58+
)"
59+
60+
if [ -z "$BEST_PKG" ]; then
61+
echo "Failed to determine Lua package"
62+
exit 1
63+
fi
64+
65+
echo "lua_pkg=$BEST_PKG" >> "$GITHUB_OUTPUT"
66+
echo "Using $BEST_PKG"
67+
3668
- name: Setup Dependencies (common)
3769
run: |
3870
sudo dpkg --add-architecture ${{ matrix.platform.arch }}
3971
sudo apt-get update -y -qq
4072
sudo apt-get install -y libyajl-dev:${{ matrix.platform.arch }} \
4173
libcurl4-openssl-dev:${{ matrix.platform.arch }} \
4274
liblmdb-dev:${{ matrix.platform.arch }} \
43-
liblua5.2-dev:${{ matrix.platform.arch }} \
75+
${{ steps.detect_lua.outputs.lua_pkg }}:${{ matrix.platform.arch }} \
4476
libmaxminddb-dev:${{ matrix.platform.arch }} \
4577
libpcre2-dev:${{ matrix.platform.arch }} \
4678
pcre2-utils:${{ matrix.platform.arch }} \
47-
bison flex
79+
bison flex python3 python3-venv
4880
- name: Setup Dependencies (x32)
4981
if: ${{ matrix.platform.label == 'x32' }}
5082
run: |
@@ -54,11 +86,11 @@ jobs:
5486
- name: Setup Dependencies (x64)
5587
if: ${{ matrix.platform.label == 'x64' }}
5688
run: |
57-
sudo apt-get install -y libgeoip-dev:${{ matrix.platform.arch }} \
58-
libfuzzy-dev:${{ matrix.platform.arch }}
59-
- uses: actions/checkout@v4
89+
sudo apt-get install -y libfuzzy-dev:${{ matrix.platform.arch }}
90+
91+
- uses: actions/checkout@v6
6092
with:
61-
submodules: true
93+
submodules: recursive
6294
fetch-depth: 0
6395
- name: build.sh
6496
run: ./build.sh
@@ -77,6 +109,7 @@ jobs:
77109
name: macOS (${{ matrix.configure.label }})
78110
runs-on: ${{ matrix.os }}
79111
strategy:
112+
fail-fast: false
80113
matrix:
81114
os: [macos-14]
82115
configure:
@@ -105,21 +138,12 @@ jobs:
105138
ssdeep \
106139
pcre \
107140
bison \
108-
flex
109-
- uses: actions/checkout@v4
141+
flex
142+
143+
- uses: actions/checkout@v6
110144
with:
111-
submodules: true
145+
submodules: recursive
112146
fetch-depth: 0
113-
- name: Build GeoIP
114-
run: |
115-
git clone --depth 1 --no-checkout https://github.com/maxmind/geoip-api-c.git
116-
cd geoip-api-c
117-
git fetch --tags
118-
# Check out the last release, v1.6.12
119-
git checkout 4b526e7331ca1d692b74a0509ddcc725622ed31a
120-
autoreconf --install
121-
./configure --disable-dependency-tracking --disable-silent-rules --prefix=/opt/homebrew
122-
make install
123147
- name: build.sh
124148
run: ./build.sh
125149
- name: configure
@@ -134,6 +158,7 @@ jobs:
134158
name: Windows (${{ matrix.platform.label }}, ${{ matrix.configure.label }})
135159
runs-on: ${{ matrix.os }}
136160
strategy:
161+
fail-fast: false
137162
matrix:
138163
os: [windows-2022]
139164
platform:
@@ -147,9 +172,9 @@ jobs:
147172
- {label: "wo libxml", opt: "-DWITH_LIBXML2=OFF" }
148173
- {label: "with lmdb", opt: "-DWITH_LMDB=ON" }
149174
steps:
150-
- uses: actions/checkout@v4
175+
- uses: actions/checkout@v6
151176
with:
152-
submodules: true
177+
submodules: recursive
153178
fetch-depth: 0
154179
- name: Install Conan
155180
run: |
@@ -195,9 +220,10 @@ jobs:
195220
automake \
196221
libtool \
197222
cppcheck
198-
- uses: actions/checkout@v4
223+
224+
- uses: actions/checkout@v6
199225
with:
200-
submodules: true
226+
submodules: recursive
201227
fetch-depth: 0
202228
- name: configure
203229
run: |

.github/workflows/ci_new.yml

Lines changed: 82 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,39 @@ jobs:
4040
fetch-depth: 0
4141
submodules: recursive
4242

43-
- name: Install dependencies
43+
- name: Detect latest Lua dev package
44+
id: detect_lua
45+
shell: bash
4446
run: |
47+
set -euo pipefail
48+
4549
sudo apt-get update -y -qq
50+
51+
CANDIDATES="$(apt-cache search '^liblua[0-9]+\.[0-9]+-dev$' | awk '{print $1}')"
52+
53+
if [ -z "$CANDIDATES" ]; then
54+
echo "No libluaX.Y-dev package found"
55+
exit 1
56+
fi
57+
58+
BEST_PKG="$(
59+
printf '%s\n' "$CANDIDATES" \
60+
| sed -E 's/^liblua([0-9]+\.[0-9]+)-dev$/\1 &/' \
61+
| sort -V \
62+
| tail -n1 \
63+
| awk '{print $2}'
64+
)"
65+
66+
echo "lua_pkg=$BEST_PKG" >> "$GITHUB_OUTPUT"
67+
echo "Using $BEST_PKG"
68+
69+
- name: Install dependencies
70+
run: |
4671
sudo apt-get install -y \
4772
libyajl-dev \
4873
libcurl4-openssl-dev \
4974
liblmdb-dev \
50-
liblua5.2-dev \
75+
${{ steps.detect_lua.outputs.lua_pkg }} \
5176
libmaxminddb-dev \
5277
libpcre2-dev \
5378
libxml2-dev \
@@ -56,8 +81,9 @@ jobs:
5681
libpcre3-dev \
5782
bison \
5883
flex \
59-
pkg-config
60-
84+
pkg-config \
85+
python3 \
86+
python3-venv
6187
6288
- name: Run build preparation script
6389
run: ./build.sh
@@ -78,11 +104,12 @@ jobs:
78104

79105
build-macos:
80106
name: macOS (${{ matrix.configure.label }})
81-
runs-on: macos-15
107+
runs-on: ${{ matrix.os }}
82108

83109
strategy:
84110
fail-fast: false
85111
matrix:
112+
os: [macos-15, macos-26]
86113
configure:
87114
- { label: "with parser generation", opt: "--enable-parser-generation" }
88115
- { label: "without curl", opt: "--without-curl" }
@@ -196,7 +223,7 @@ jobs:
196223

197224
cppcheck:
198225
name: Static analysis (cppcheck)
199-
runs-on: macos-15
226+
runs-on: macos-26
200227

201228
steps:
202229
- uses: actions/checkout@v6
@@ -234,11 +261,47 @@ jobs:
234261
with:
235262
fetch-depth: 0
236263
submodules: recursive
264+
265+
- name: Detect latest Lua packages
266+
id: detect_lua
267+
shell: bash
268+
run: |
269+
set -euo pipefail
237270
271+
apt-get update
272+
273+
CANDIDATES="$(apt-cache pkgnames | grep -E '^liblua[0-9]+\.[0-9]+-dev$' || true)"
274+
275+
if [ -z "$CANDIDATES" ]; then
276+
echo "No libluaX.Y-dev package found"
277+
exit 1
278+
fi
279+
280+
BEST_PKG="$(
281+
printf '%s\n' "$CANDIDATES" \
282+
| sed -E 's/^liblua([0-9]+\.[0-9]+)-dev$/\1 &/' \
283+
| sort -V \
284+
| tail -n1 \
285+
| awk '{print $2}'
286+
)"
287+
288+
if [ -z "$BEST_PKG" ]; then
289+
echo "Failed to determine Lua dev package"
290+
printf '%s\n' "$CANDIDATES"
291+
exit 1
292+
fi
293+
294+
BEST_VER="$(printf '%s\n' "$BEST_PKG" | sed -E 's/^liblua([0-9]+\.[0-9]+)-dev$/\1/')"
295+
LUA_PKG="lua$BEST_VER"
296+
297+
echo "lua_dev_pkg=$BEST_PKG" >> "$GITHUB_OUTPUT"
298+
echo "lua_pkg=$LUA_PKG" >> "$GITHUB_OUTPUT"
299+
300+
echo "Using dev package: $BEST_PKG"
301+
echo "Using interpreter: $LUA_PKG"
238302
239303
- name: Install dependencies (v2 style)
240304
run: |
241-
apt-get update
242305
apt-get install -y \
243306
autoconf \
244307
automake \
@@ -249,15 +312,24 @@ jobs:
249312
libyajl-dev \
250313
libcurl4-openssl-dev \
251314
liblmdb-dev \
252-
liblua5.2-dev \
315+
${{ steps.detect_lua.outputs.lua_dev_pkg }} \
316+
${{ steps.detect_lua.outputs.lua_pkg }} \
253317
libmaxminddb-dev \
254318
libpcre2-dev \
255319
libxml2-dev \
256320
libfuzzy-dev \
257321
pcre2-utils \
258322
bison \
259-
flex
260-
323+
flex \
324+
python3 \
325+
python3-venv
326+
327+
- name: Show Lua installation
328+
run: |
329+
which lua || true
330+
lua -v || true
331+
dpkg -l | grep lua || true
332+
261333
- name: Run build preparation script
262334
run: ./build.sh
263335

0 commit comments

Comments
 (0)