Skip to content

Commit 6999096

Browse files
Refactor Meson CI workflow for efficiency
Updated CI workflow to remove unused paths and MSVC versions, and improved macOS setup steps.
1 parent 6b2050a commit 6999096

File tree

1 file changed

+39
-133
lines changed

1 file changed

+39
-133
lines changed

.github/workflows/meson_ci.yml

Lines changed: 39 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
11
name: Meson CI
22

33
on:
4+
schedule:
5+
- cron: '15 21 * * *'
46
push:
5-
paths:
6-
- "**.c"
7-
- "**.h"
8-
- "**.py"
9-
- "**.build"
10-
- "**.options"
7+
branches:
8+
- main
119
pull_request:
12-
paths:
13-
- "**.c"
14-
- "**.h"
15-
- "**.py"
16-
- "**.build"
17-
- "**.options"
10+
branches:
11+
- main
1812

1913
jobs:
2014
build_msvc:
2115
name: Building on MSVC ${{ matrix.msvc_version }}
2216
runs-on: windows-latest
2317
strategy:
2418
matrix:
25-
msvc_version: [2015, 2017, 2019, 2022, 2025]
19+
msvc_version: [2019, 2022, 2025]
2620
steps:
2721
- name: Checkout code
28-
uses: actions/checkout@v4
22+
uses: actions/checkout@v5
2923
with:
3024
fetch-depth: 0
3125

@@ -39,11 +33,7 @@ jobs:
3933
run: |
4034
python -m pip install --upgrade pip
4135
python -m pip install meson ninja
42-
if ($env:msvc_version -eq "2015") {
43-
choco install visualstudio2015buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --includeRecommended --includeOptional --passive"
44-
} elseif ($env:msvc_version -eq "2017") {
45-
choco install visualstudio2017buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive"
46-
} elseif ($env:msvc_version -eq "2019") {
36+
if ($env:msvc_version -eq "2019") {
4737
choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive"
4838
} elseif ($env:msvc_version -eq "2022") {
4939
choco install visualstudio2022buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive"
@@ -60,14 +50,11 @@ jobs:
6050
run: meson test -C builddir_msvc_${{ matrix.msvc_version }} -v --test-args='show --mode tree --verbose ci --result fail'
6151

6252
build_macosx:
63-
name: Building on macOS with Xcode ${{ matrix.xcode_version }}
53+
name: Building on MacOSX
6454
runs-on: macos-latest
65-
strategy:
66-
matrix:
67-
xcode_version: ["15.2", "15.3"]
6855
steps:
6956
- name: Checkout code
70-
uses: actions/checkout@v4
57+
uses: actions/checkout@v5
7158
with:
7259
fetch-depth: 0
7360

@@ -76,19 +63,36 @@ jobs:
7663
with:
7764
python-version: '3.12'
7865

66+
- name: Install Xcode Command Line Tools
67+
run: |
68+
if ! xcode-select -p &>/dev/null; then
69+
sudo xcode-select --install
70+
until xcode-select -p &>/dev/null; do sleep 5; done
71+
fi
72+
7973
- name: Install Xcode
80-
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode_version }}.app
81-
82-
- name: Install Meson and Ninja
74+
run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
75+
76+
- name: Install Meson, Ninja
8377
run: |
8478
python -m pip install meson ninja
85-
79+
8680
- name: Configure
87-
run: meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3
81+
run: OBJC=clang OBJCXX=clang++ meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3
82+
83+
- name: Compile
84+
run: meson compile -C builddir
8885

8986
- name: Run Tests
90-
run: meson test -C builddir -v --test-args='show --mode tree --verbose ci --result fail'
91-
87+
run: meson test -C builddir -v
88+
89+
- name: Upload Test Log
90+
if: failure()
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: macos_xcode_${{ matrix.xcode_version }}_meson_testlog
94+
path: builddir/meson-logs/testlog.txt
95+
9296
build_msys:
9397
name: Building on MSYS ${{ matrix.architecture }}
9498
runs-on: windows-latest
@@ -97,7 +101,7 @@ jobs:
97101
architecture: [x86, x64]
98102
steps:
99103
- name: Checkout code
100-
uses: actions/checkout@v4
104+
uses: actions/checkout@v5
101105
with:
102106
fetch-depth: 0
103107

@@ -134,7 +138,7 @@ jobs:
134138
architecture: [x86, x64]
135139
steps:
136140
- name: Checkout code
137-
uses: actions/checkout@v4
141+
uses: actions/checkout@v5
138142
with:
139143
fetch-depth: 0
140144

@@ -173,11 +177,11 @@ jobs:
173177

174178
strategy:
175179
matrix:
176-
distro: [ubuntu, fedora, archlinux, debian]
180+
distro: [ubuntu, fedora, archlinux, debian] # in a new experiment add alpine and opensuse
177181

178182
steps:
179183
- name: Checkout code
180-
uses: actions/checkout@v4
184+
uses: actions/checkout@v5
181185
with:
182186
fetch-depth: 0
183187

@@ -208,101 +212,3 @@ jobs:
208212
sudo apt update
209213
meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3
210214
meson test -C builddir -v --test-args='show --mode tree --verbose ci --result fail'"
211-
212-
build_cross:
213-
name: Building on Bedrock ${{ matrix.architecture }}
214-
runs-on: ubuntu-latest # Using Ubuntu as the base system for cross-compilation
215-
216-
strategy:
217-
matrix:
218-
architecture: [arm, arm64, mips, mipsel, riscv64, ppc, ppc64le, sparc64, s390x]
219-
220-
steps:
221-
- name: Checkout code
222-
uses: actions/checkout@v4
223-
with:
224-
fetch-depth: 0
225-
226-
- name: Set up Python
227-
uses: actions/setup-python@v5
228-
with:
229-
python-version: '3.12'
230-
231-
- name: Install Cross-Compilation Toolchain
232-
run: |
233-
sudo apt update
234-
if [ "${{ matrix.architecture }}" == "arm" ]; then
235-
sudo apt install -y gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
236-
elif [ "${{ matrix.architecture }}" == "arm64" ]; then
237-
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
238-
elif [ "${{ matrix.architecture }}" == "mips" ]; then
239-
sudo apt install -y gcc-mips-linux-gnu g++-mips-linux-gnu
240-
elif [ "${{ matrix.architecture }}" == "mipsel" ]; then
241-
sudo apt install -y gcc-mipsel-linux-gnu g++-mipsel-linux-gnu
242-
elif [ "${{ matrix.architecture }}" == "riscv64" ]; then
243-
sudo apt install -y gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
244-
elif [ "${{ matrix.architecture }}" == "ppc" ]; then
245-
sudo apt install -y gcc-powerpc-linux-gnu g++-powerpc-linux-gnu
246-
elif [ "${{ matrix.architecture }}" == "ppc64le" ]; then
247-
sudo apt install -y gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu
248-
elif [ "${{ matrix.architecture }}" == "sparc64" ]; then
249-
sudo apt install -y gcc-sparc64-linux-gnu g++-sparc64-linux-gnu
250-
elif [ "${{ matrix.architecture }}" == "s390x" ]; then
251-
sudo apt install -y gcc-s390x-linux-gnu g++-s390x-linux-gnu
252-
fi
253-
254-
- name: Set Cross-Compilation Environment Variables
255-
run: |
256-
if [ "${{ matrix.architecture }}" == "arm" ]; then
257-
echo "CC=arm-linux-gnueabi-gcc" >> $GITHUB_ENV
258-
echo "CXX=arm-linux-gnueabi-g++" >> $GITHUB_ENV
259-
echo "CROSS_FILE=.github/crossfiles/arm.txt" >> $GITHUB_ENV
260-
elif [ "${{ matrix.architecture }}" == "arm64" ]; then
261-
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
262-
echo "CXX=aarch64-linux-gnu-g++" >> $GITHUB_ENV
263-
echo "CROSS_FILE=.github/crossfiles/arm64.txt" >> $GITHUB_ENV
264-
elif [ "${{ matrix.architecture }}" == "mips" ]; then
265-
echo "CC=mips-linux-gnu-gcc" >> $GITHUB_ENV
266-
echo "CXX=mips-linux-gnu-g++" >> $GITHUB_ENV
267-
echo "CROSS_FILE=.github/crossfiles/mips.txt" >> $GITHUB_ENV
268-
elif [ "${{ matrix.architecture }}" == "mipsel" ]; then
269-
echo "CC=mipsel-linux-gnu-gcc" >> $GITHUB_ENV
270-
echo "CXX=mipsel-linux-gnu-g++" >> $GITHUB_ENV
271-
echo "CROSS_FILE=.github/crossfiles/mipsel.txt" >> $GITHUB_ENV
272-
elif [ "${{ matrix.architecture }}" == "riscv64" ]; then
273-
echo "CC=riscv64-linux-gnu-gcc" >> $GITHUB_ENV
274-
echo "CXX=riscv64-linux-gnu-g++" >> $GITHUB_ENV
275-
echo "CROSS_FILE=.github/crossfiles/riscv64.txt" >> $GITHUB_ENV
276-
elif [ "${{ matrix.architecture }}" == "ppc" ]; then
277-
echo "CC=powerpc-linux-gnu-gcc" >> $GITHUB_ENV
278-
echo "CXX=powerpc-linux-gnu-g++" >> $GITHUB_ENV
279-
echo "CROSS_FILE=.github/crossfiles/ppc.txt" >> $GITHUB_ENV
280-
elif [ "${{ matrix.architecture }}" == "ppc64le" ]; then
281-
echo "CC=powerpc64le-linux-gnu-gcc" >> $GITHUB_ENV
282-
echo "CXX=powerpc64le-linux-gnu-g++" >> $GITHUB_ENV
283-
echo "CROSS_FILE=.github/crossfiles/ppc64le.txt" >> $GITHUB_ENV
284-
elif [ "${{ matrix.architecture }}" == "sparc64" ]; then
285-
echo "CC=sparc64-linux-gnu-gcc" >> $GITHUB_ENV
286-
echo "CXX=sparc64-linux-gnu-g++" >> $GITHUB_ENV
287-
echo "CROSS_FILE=.github/crossfiles/sparc64.txt" >> $GITHUB_ENV
288-
elif [ "${{ matrix.architecture }}" == "s390x" ]; then
289-
echo "CC=s390x-linux-gnu-gcc" >> $GITHUB_ENV
290-
echo "CXX=s390x-linux-gnu-g++" >> $GITHUB_ENV
291-
echo "CROSS_FILE=.github/crossfiles/s390x.txt" >> $GITHUB_ENV
292-
fi
293-
294-
- name: Install Meson
295-
run: |
296-
python -m pip install meson ninja
297-
298-
- name: Configure the Project
299-
run: |
300-
meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3 --cross-file $CROSS_FILE
301-
302-
- name: Build the Project
303-
run: |
304-
meson compile -C builddir
305-
306-
- name: Test the Project
307-
run: |
308-
meson test -C builddir -v --test-args='show --mode tree --verbose ci --result fail'

0 commit comments

Comments
 (0)