Skip to content

Commit 2574f5f

Browse files
CI: Run LMMS
This runs `lmms --version` and `lmms --help` in the github CI. Further checks, like importing an LMMS project to WAV via CLI, are conceivable.
1 parent 735e483 commit 2574f5f

File tree

1 file changed

+59
-11
lines changed

1 file changed

+59
-11
lines changed

.github/workflows/build.yml

Lines changed: 59 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ jobs:
5151
run: |
5252
cmake --build build --target install
5353
cmake --build build --target appimage
54+
- name: Display help
55+
run: >
56+
build/install/bin/lmms --help | grep "Usage: lmms"
57+
- name: Display version
58+
run: build/install/bin/lmms --version | grep "Copyright (c) .* LMMS Developers"
5459
- name: Upload artifacts
5560
uses: actions/upload-artifact@v4
5661
with:
@@ -144,6 +149,11 @@ jobs:
144149
run: |
145150
cmake --build build --target install
146151
cmake --build build --target dmg
152+
- name: Display help
153+
run: >
154+
build/LMMS.app/Contents/MacOS/lmms --help | grep "Usage: lmms"
155+
- name: Display version
156+
run: build/LMMS.app/Contents/MacOS/lmms --version | grep "Copyright (c) .* LMMS Developers"
147157
- name: Upload artifacts
148158
uses: actions/upload-artifact@v4
149159
with:
@@ -193,6 +203,12 @@ jobs:
193203
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
194204
- name: Configure git
195205
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
206+
- name: Install wine and p7zip
207+
run: |
208+
apt-get --yes install wine-stable p7zip-full
209+
dpkg --add-architecture i386 # add i386 arch for wine32
210+
apt-get --yes update
211+
apt-get --yes install wine32
196212
- name: Check out
197213
uses: actions/checkout@v3
198214
with:
@@ -219,6 +235,20 @@ jobs:
219235
run: cmake --build build
220236
- name: Package
221237
run: cmake --build build --target package
238+
- name: Unpack
239+
run: |
240+
mkdir build/install
241+
7z x -obuild/install build/lmms-*.exe
242+
- name: Display help
243+
run: >
244+
WINEPREFIX=/tmp/lmms-wineprefix
245+
wine "build/install/lmms.exe" --help |
246+
grep "Usage: lmms"
247+
- name: Display version
248+
run: >
249+
WINEPREFIX=/tmp/lmms-wineprefix
250+
wine "build/install/lmms.exe" --version |
251+
grep "Copyright (c) .* LMMS Developers"
222252
- name: Upload artifacts
223253
uses: actions/upload-artifact@v4
224254
with:
@@ -237,8 +267,12 @@ jobs:
237267
strategy:
238268
fail-fast: false
239269
matrix:
240-
arch: ['x86', 'x64']
241-
name: msvc-${{ matrix.arch }}
270+
config:
271+
- arch: 'x86'
272+
programfiles-suffix: '(x86)'
273+
- arch: 'x64'
274+
programfiles-suffix: ''
275+
name: msvc-${{ matrix.config.arch }}
242276
runs-on: windows-2019
243277
env:
244278
CCACHE_MAXSIZE: 0
@@ -253,19 +287,19 @@ jobs:
253287
id: cache-deps
254288
uses: actions/cache@v3
255289
with:
256-
key: vcpkg-${{ matrix.arch }}-${{ hashFiles('vcpkg.json') }}
290+
key: vcpkg-${{ matrix.config.arch }}-${{ hashFiles('vcpkg.json') }}
257291
restore-keys: |
258-
vcpkg-${{ matrix.arch }}-
292+
vcpkg-${{ matrix.config.arch }}-
259293
path: build\vcpkg_installed
260294
- name: Cache ccache data
261295
uses: actions/cache@v3
262296
with:
263297
# yamllint disable rule:line-length
264-
key: "ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}\
298+
key: "ccache-${{ github.job }}-${{ matrix.config.arch }}-${{ github.ref }}\
265299
-${{ github.run_id }}"
266300
restore-keys: |
267-
ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}-
268-
ccache-${{ github.job }}-${{ matrix.arch }}-
301+
ccache-${{ github.job }}-${{ matrix.config.arch }}-${{ github.ref }}-
302+
ccache-${{ github.job }}-${{ matrix.config.arch }}-
269303
path: ~\AppData\Local\ccache
270304
# yamllint enable rule:line-length
271305
- name: Install tools
@@ -288,7 +322,7 @@ jobs:
288322
- name: Set up build environment
289323
uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89
290324
with:
291-
arch: ${{ matrix.arch }}
325+
arch: ${{ matrix.config.arch }}
292326
- name: Configure
293327
run: |
294328
ccache --zero-stats
@@ -301,8 +335,8 @@ jobs:
301335
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
302336
-DUSE_COMPILE_CACHE=ON `
303337
-DUSE_WERROR=ON `
304-
-DVCPKG_TARGET_TRIPLET="${{ matrix.arch }}-windows" `
305-
-DVCPKG_HOST_TRIPLET="${{ matrix.arch }}-windows" `
338+
-DVCPKG_TARGET_TRIPLET="${{ matrix.config.arch }}-windows" `
339+
-DVCPKG_HOST_TRIPLET="${{ matrix.config.arch }}-windows" `
306340
-DVCPKG_MANIFEST_INSTALL="${{ env.should_install_manifest }}"
307341
env:
308342
should_install_manifest:
@@ -315,10 +349,24 @@ jobs:
315349
ctest --output-on-failure -j2
316350
- name: Package
317351
run: cmake --build build --target package
352+
- name: Unpack
353+
run: Start-Process @(gci build/lmms-*.exe)[0] -ArgumentList /S -Wait
354+
# yamllint disable rule:line-length
355+
- name: Display help
356+
run: >
357+
$result = & "${env:ProgramFiles${{ matrix.config.programfiles-suffix }}}/LMMS/lmms.exe" "--help" |
358+
Select-String "Usage: lmms";
359+
if($result.Matches.Count -eq 0) { exit 1 }
360+
- name: Display version
361+
run: >
362+
$result = & "${env:ProgramFiles${{ matrix.config.programfiles-suffix }}}/LMMS/lmms.exe" "--version" |
363+
Select-String -Pattern "Copyright \(c\) .* LMMS Developers";
364+
if($result.Matches.Count -eq 0) { exit 1 }
365+
# yamllint enable rule:line-length
318366
- name: Upload artifacts
319367
uses: actions/upload-artifact@v4
320368
with:
321-
name: msvc-${{ matrix.arch }}
369+
name: msvc-${{ matrix.config.arch }}
322370
path: build\lmms-*.exe
323371
- name: Trim ccache and print statistics
324372
run: |

0 commit comments

Comments
 (0)