@@ -38,3 +38,218 @@ jobs:
3838 with :
3939 name : ${{ matrix.os }}_Meson_Testlog
4040 path : builddir/meson-logs/testlog.txt
41+
42+
43+
44+ on :
45+ schedule :
46+ - cron : ' 15 21 * * *'
47+ push :
48+ branches :
49+ - main
50+ pull_request :
51+ branches :
52+ - main
53+
54+ jobs :
55+ build_msvc :
56+ name : Building on MSVC ${{ matrix.msvc_version }}
57+ runs-on : windows-latest
58+ strategy :
59+ matrix :
60+ msvc_version : [2019, 2022, 2025]
61+ steps :
62+ - name : Checkout code
63+ uses : actions/checkout@v5
64+ with :
65+ fetch-depth : 0
66+
67+ - name : Set up Python
68+ uses : actions/setup-python@v6
69+ with :
70+ python-version : ' 3.12'
71+
72+ - name : Install Meson and Ninja
73+ shell : pwsh
74+ run : |
75+ python -m pip install --upgrade pip
76+ python -m pip install meson ninja
77+ if ($env:msvc_version -eq "2019") {
78+ choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive"
79+ } elseif ($env:msvc_version -eq "2022") {
80+ choco install visualstudio2022buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive"
81+ } elseif ($env:msvc_version -eq "2025") {
82+ choco install visualstudio2025buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive"
83+ }
84+ $env:CC="cl.exe"
85+ $env:CXX="cl.exe"
86+
87+ - name : Configure
88+ run : meson setup builddir_msvc_${{ matrix.msvc_version }} --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3
89+
90+ - name : Run Tests
91+ run : meson test -C builddir_msvc_${{ matrix.msvc_version }} -v --test-args='show --mode tree --verbose ci --result fail'
92+
93+ build_macosx :
94+ name : Building on MacOSX
95+ runs-on : macos-latest
96+ steps :
97+ - name : Checkout code
98+ uses : actions/checkout@v5
99+ with :
100+ fetch-depth : 0
101+
102+ - name : Set up Python
103+ uses : actions/setup-python@v6
104+ with :
105+ python-version : ' 3.12'
106+
107+ - name : Install Xcode Command Line Tools
108+ run : |
109+ if ! xcode-select -p &>/dev/null; then
110+ sudo xcode-select --install
111+ until xcode-select -p &>/dev/null; do sleep 5; done
112+ fi
113+
114+ - name : Install Xcode
115+ run : sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
116+
117+ - name : Install Meson, Ninja
118+ run : |
119+ python -m pip install meson ninja
120+
121+ - name : Configure
122+ run : OBJC=clang OBJCXX=clang++ meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3
123+
124+ - name : Compile
125+ run : meson compile -C builddir
126+
127+ - name : Run Tests
128+ run : meson test -C builddir -v
129+
130+ - name : Upload Test Log
131+ if : failure()
132+ uses : actions/upload-artifact@v4
133+ with :
134+ name : macos_xcode_${{ matrix.xcode_version }}_meson_testlog
135+ path : builddir/meson-logs/testlog.txt
136+
137+ build_msys :
138+ name : Building on MSYS ${{ matrix.architecture }}
139+ runs-on : windows-latest
140+ strategy :
141+ matrix :
142+ architecture : [x86, x64]
143+ steps :
144+ - name : Checkout code
145+ uses : actions/checkout@v5
146+ with :
147+ fetch-depth : 0
148+
149+ - name : Set up MSYS2
150+ uses : msys2/setup-msys2@v2
151+ with :
152+ update : true
153+
154+ - name : Set environment variables
155+ run : |
156+ echo "CC=/mingw${{ matrix.architecture }}/bin/gcc.exe" >> $GITHUB_ENV
157+ echo "CXX=/mingw${{ matrix.architecture }}/bin/g++.exe" >> $GITHUB_ENV
158+
159+ - name : Set up Python
160+ uses : actions/setup-python@v6
161+ with :
162+ python-version : ' 3.12'
163+
164+ - name : Install Meson and Ninja
165+ run : |
166+ python -m pip install meson ninja
167+
168+ - name : Configure
169+ run : meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3
170+
171+ - name : Run Tests
172+ run : meson test -C builddir -v --test-args='show --mode tree --verbose ci --result fail'
173+
174+ build_mingw :
175+ name : Building on MinGW ${{ matrix.architecture }}
176+ runs-on : windows-latest
177+ strategy :
178+ matrix :
179+ architecture : [x86, x64]
180+ steps :
181+ - name : Checkout code
182+ uses : actions/checkout@v5
183+ with :
184+ fetch-depth : 0
185+
186+ - name : Install MinGW
187+ run : |
188+ choco install mingw
189+
190+ - name : Set environment variables
191+ run : |
192+ if ($env:matrix_architecture -eq "x86") {
193+ $env:CC="C:/tools/mingw32/bin/gcc.exe"
194+ $env:CXX="C:/tools/mingw32/bin/g++.exe"
195+ } else {
196+ $env:CC="C:/tools/mingw64/bin/gcc.exe"
197+ $env:CXX="C:/tools/mingw64/bin/g++.exe"
198+ }
199+
200+ - name : Set up Python
201+ uses : actions/setup-python@v6
202+ with :
203+ python-version : ' 3.12'
204+
205+ - name : Install Meson and Ninja
206+ run : |
207+ python -m pip install meson ninja
208+
209+ - name : Configure
210+ run : meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3
211+
212+ - name : Run Tests
213+ run : meson test -C builddir -v --test-args='show --mode tree --verbose ci --result fail'
214+
215+ build_posix :
216+ name : Build on Linux ${{ matrix.distro }}
217+ runs-on : ubuntu-latest
218+
219+ strategy :
220+ matrix :
221+ distro : [ubuntu, fedora, archlinux, debian] # in a new experiment add alpine and opensuse
222+
223+ steps :
224+ - name : Checkout code
225+ uses : actions/checkout@v5
226+ with :
227+ fetch-depth : 0
228+
229+ - name : Set up Docker Buildx
230+ uses : docker/setup-buildx-action@v3
231+
232+ - name : Cache Docker layers
233+ uses : actions/cache@v4
234+ with :
235+ path : /tmp/.buildx-cache
236+ key : ${{ runner.os }}-buildx-${{ matrix.distro }}
237+ restore-keys : |
238+ ${{ runner.os }}-buildx
239+
240+ - name : Build Docker Image
241+ run : |
242+ docker build \
243+ --file .github/ciimage/Dockerfile.${{ matrix.distro }} \
244+ --tag ${GITHUB_REPOSITORY}:${{ matrix.distro }} .
245+
246+ - name : Run Meson Build in Docker Container
247+ run : |
248+ docker run --rm \
249+ -v ${{ github.workspace }}:/workspace \
250+ -w /workspace \
251+ ${GITHUB_REPOSITORY}:${{ matrix.distro }} \
252+ /bin/bash -c "
253+ sudo apt update
254+ meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3
255+ meson test -C builddir -v --test-args='show --mode tree --verbose ci --result fail'"
0 commit comments