Skip to content

Commit 0c5913f

Browse files
committed
Update CI workflow to use macOS 15
1 parent 1c78d67 commit 0c5913f

File tree

1 file changed

+82
-60
lines changed

1 file changed

+82
-60
lines changed

.github/workflows/ci.yml

Lines changed: 82 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -11,70 +11,92 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
os:
15-
- macos-14
16-
runs-on: ${{ matrix.os }}
14+
target:
15+
- macos-aarch64-dyn
16+
- macos-x86_64-dyn
17+
include:
18+
- target: macos-aarch64-dyn
19+
arch_name: arm64-apple-macos
20+
run_test: true
21+
- target: macos-x86_64-dyn
22+
arch_name: x86_64-apple-darwin
23+
run_test: true
24+
runs-on: macos-15
1725

1826
steps:
27+
- name: Harden Runner
28+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # pin@v2
29+
with:
30+
egress-policy: audit
31+
1932
- name: Checkout code
20-
uses: actions/checkout@v4
33+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # pin@v4
2134

22-
- name: Setup Python 3.12
23-
uses: actions/setup-python@v5
35+
- name: Setup Python 3.13
36+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # pin@v5
2437
with:
25-
python-version: '3.12'
38+
python-version: '3.13'
2639

2740
- name: Install packages
2841
run: |
2942
brew update
30-
brew unlink python3
31-
# upgrade from [email protected] to [email protected] fails to overwrite those
32-
rm -f /usr/local/bin/2to3 /usr/local/bin/2to3-3.12 /usr/local/bin/idle3 /usr/local/bin/idle3.12 /usr/local/bin/pydoc3 /usr/local/bin/pydoc3.12 /usr/local/bin/python3 /usr/local/bin/python3-config /usr/local/bin/python3.12 /usr/local/bin/python3.12-config
33-
brew install gcovr ninja libmagic
43+
brew install gcovr || brew link --overwrite python # ninja
3444
3545
- name: Install Python modules
36-
run: pip3 install meson==0.49.2 pytest
46+
run: pip3 install meson pytest
3747

3848
- name: Install dependencies
39-
uses: kiwix/kiwix-build/actions/dl_deps_archive@main
49+
uses: kiwix/kiwix-build/actions/dl_deps_archive@75cfff14d7eeff9d6975f35c54ca59960dff7d05 # pin@main
4050
with:
41-
target_platform: macos-x86_64-dyn
51+
target_platform: ${{ matrix.target }}
4252

4353
- name: Compile
4454
shell: bash
4555
run: |
46-
export PKG_CONFIG_PATH=$HOME/BUILD_x86_64-apple-darwin/INSTALL/lib/pkgconfig
47-
export CPPFLAGS="-I$HOME/BUILD_x86_64-apple-darwin/INSTALL/include"
48-
meson . build
56+
MESON_CROSSFILE="$HOME/BUILD_${{matrix.arch_name}}/meson_cross_file.txt"
57+
if [ -e "$MESON_CROSSFILE" ]; then
58+
MESON_OPTION="$MESON_OPTION --cross-file \"$MESON_CROSSFILE\" -Dstatic-linkage=true"
59+
cat "$MESON_CROSSFILE"
60+
fi
61+
export PKG_CONFIG_PATH=$HOME/BUILD_${{matrix.arch_name}}/INSTALL/lib/pkgconfig
62+
export CPPFLAGS="-I$HOME/BUILD_${{matrix.arch_name}}/INSTALL/include"
63+
meson . build ${MESON_OPTION}
4964
cd build
5065
ninja
5166
67+
- name: Test
68+
if: matrix.run_test
69+
shell: bash
70+
run: |
71+
export LD_LIBRARY_PATH=$HOME/BUILD_${{matrix.arch_name}}/INSTALL/lib:$HOME/BUILD_${{matrix.arch_name}}/INSTALL/lib64
72+
cd build
73+
meson test --verbose
74+
5275
Windows:
5376
runs-on: windows-2022
5477

5578
steps:
5679
- name: Checkout code
57-
uses: actions/checkout@v4
80+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # pin@v4
5881

5982
- name: Setup python 3.10
60-
uses: actions/setup-python@v5
83+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # pin@v5
6184
with:
6285
python-version: '3.10'
6386

6487
- name: Install packages
65-
run:
66-
choco install pkgconfiglite ninja
88+
run: choco install pkgconfiglite ninja
6789

6890
- name: Install python modules
6991
run: pip3 install meson
7092

7193
- name: Setup MSVC compiler
72-
uses: bus1/cabuild/action/msdevshell@v1
94+
uses: bus1/cabuild/action/msdevshell@06ea2833eef61e9b0d0ce0d728416e617e4fb1fe # pin@v1
7395
with:
7496
architecture: x64
7597

7698
- name: Install dependencies
77-
uses: kiwix/kiwix-build/actions/dl_deps_archive@main
99+
uses: kiwix/kiwix-build/actions/dl_deps_archive@75cfff14d7eeff9d6975f35c54ca59960dff7d05 # pin@main
78100
with:
79101
target_platform: win-x86_64-static
80102

@@ -121,40 +143,40 @@ jobs:
121143
container:
122144
image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:2025-06-07"
123145
steps:
124-
- name: Checkout code
125-
uses: actions/checkout@v4
126-
- name: Install dependencies
127-
uses: kiwix/kiwix-build/actions/dl_deps_archive@main
128-
with:
129-
target_platform: ${{ matrix.target }}
130-
- name: Compile
131-
shell: bash
132-
run: |
133-
if [[ "${{matrix.target}}" =~ .*-static ]]; then
134-
MESON_OPTION="-Dstatic-linkage=true"
135-
fi
136-
if [ -e "$HOME/BUILD_${{matrix.arch_name}}/meson_cross_file.txt" ]; then
137-
MESON_OPTION="$MESON_OPTION --cross-file $HOME/BUILD_${{matrix.arch_name}}/meson_cross_file.txt"
138-
fi
139-
meson . build ${MESON_OPTION} -Db_coverage=true
140-
cd build
141-
ninja
142-
env:
143-
PKG_CONFIG_PATH: "${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/lib/pkgconfig:${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/lib${{matrix.lib_postfix}}/pkgconfig"
144-
CPPFLAGS: "-I${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/include"
145-
- name: Test
146-
if: matrix.run_test
147-
shell: bash
148-
run: |
149-
cd build
150-
meson test --verbose
151-
if [[ "${{matrix.coverage}}" = "true" ]]; then
152-
ninja coverage
153-
fi
154-
env:
155-
LD_LIBRARY_PATH: "${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/lib${{matrix.lib_postfix}}"
156-
- name: Publish coverage
157-
if: matrix.coverage
158-
uses: codecov/codecov-action@v4
159-
env:
160-
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
146+
- name: Checkout code
147+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # pin@v4
148+
- name: Install dependencies
149+
uses: kiwix/kiwix-build/actions/dl_deps_archive@75cfff14d7eeff9d6975f35c54ca59960dff7d05 # pin@main
150+
with:
151+
target_platform: ${{ matrix.target }}
152+
- name: Compile
153+
shell: bash
154+
run: |
155+
if [[ "${{matrix.target}}" =~ .*-static ]]; then
156+
MESON_OPTION="-Dstatic-linkage=true"
157+
fi
158+
if [ -e "$HOME/BUILD_${{matrix.arch_name}}/meson_cross_file.txt" ]; then
159+
MESON_OPTION="$MESON_OPTION --cross-file $HOME/BUILD_${{matrix.arch_name}}/meson_cross_file.txt"
160+
fi
161+
meson . build ${MESON_OPTION} -Db_coverage=true
162+
cd build
163+
ninja
164+
env:
165+
PKG_CONFIG_PATH: "${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/lib/pkgconfig:${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/lib${{matrix.lib_postfix}}/pkgconfig"
166+
CPPFLAGS: "-I${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/include"
167+
- name: Test
168+
if: matrix.run_test
169+
shell: bash
170+
run: |
171+
cd build
172+
meson test --verbose
173+
if [[ "${{matrix.coverage}}" = "true" ]]; then
174+
ninja coverage
175+
fi
176+
env:
177+
LD_LIBRARY_PATH: "${{env.HOME}}/BUILD_${{matrix.arch_name}}/INSTALL/lib${{matrix.lib_postfix}}"
178+
- name: Publish coverage
179+
if: matrix.coverage
180+
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v4
181+
env:
182+
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}

0 commit comments

Comments
 (0)