From 1786b434ce0a98881c7c6d9f751ba5c15b6f1f45 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Fri, 23 Feb 2024 23:08:31 +0100 Subject: [PATCH] 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. --- .github/workflows/build.yml | 16 +++++ .github/workflows/run-help.yml | 114 +++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 .github/workflows/run-help.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c2e8dd73b4..3e727da813d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -193,6 +193,16 @@ jobs: update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix - name: Configure git run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + - name: Install wine and p7zip + run: | + if [ "${{ matrix.arch }}" = "32" ]; then + dpkg --add-architecture i386 # add i386 arch for wine32 + fi + apt-get --yes update + apt-get --yes install wine-stable p7zip-full + if [ "${{ matrix.arch }}" = "32" ]; then + apt-get --yes install wine32 + fi - name: Check out uses: actions/checkout@v3 with: @@ -219,6 +229,10 @@ jobs: run: cmake --build build - name: Package run: cmake --build build --target package + - name: Unpack + run: | + mkdir build/install + 7z x -obuild/install build/lmms-*.exe - name: Upload artifacts uses: actions/upload-artifact@v4 with: @@ -315,6 +329,8 @@ jobs: ctest --output-on-failure -j2 - name: Package run: cmake --build build --target package + - name: Unpack + run: 7z x -obuild/install build/lmms-*.exe - name: Upload artifacts uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/run-help.yml b/.github/workflows/run-help.yml new file mode 100644 index 00000000000..cc1c2170ee6 --- /dev/null +++ b/.github/workflows/run-help.yml @@ -0,0 +1,114 @@ +--- +name: run-help +'on': [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + help-linux: + name: help-linux + runs-on: ubuntu-latest + #container: ghcr.io/lmms/linux.gcc:20.04 + steps: + - name: wait for build + uses: lewagon/wait-on-check-action@v1.3.4 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + check-name: 'linux' + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 30 + - name: Download workflow artifact + uses: dawidd6/action-download-artifact@v6 + with: + workflow: build.yml + name: linux + - name: Extract artifact + run: | + chmod +x lmms-*.AppImage + ./lmms-*.AppImage --appimage-extract + - name: Display help + run: | + cd squashfs-root/ + ./AppRun --help | grep "Usage: lmms" + help-macos: + strategy: + fail-fast: false + matrix: + config: + - arch: 'x86_64' + runner: 'macos-latest' + - arch: 'arm64' + runner: 'macos-latest-arm64' + name: help-macos-${{ matrix.config.arch }} + runs-on: ${{ matrix.config.runner }} + steps: + - name: wait for build + uses: lewagon/wait-on-check-action@v1.3.4 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + check-name: macos-${{ matrix.config.arch }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 30 + - name: Download workflow artifact + uses: dawidd6/action-download-artifact@v6 + with: + workflow: build.yml + name: macos-${{ matrix.config.arch }} + - name: Mount the DMG + run: | + mkdir -p /Volumes/lmms + hdiutil attach lmms-*.dmg -mountpoint /Volumes/lmms + cp -R "/Volumes/lmms/LMMS.app" /tmp/ + - name: Display help + run: | + /tmp/LMMS.app/Contents/MacOS/lmms --help | grep "Usage: lmms" + help-mingw: + strategy: + fail-fast: false + matrix: + arch: ['32', '64'] + name: help-mingw${{ matrix.arch }} + runs-on: windows-latest + steps: + - name: wait for build + uses: lewagon/wait-on-check-action@v1.3.4 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + check-name: mingw${{ matrix.arch }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 30 + - name: Download workflow artifact + uses: dawidd6/action-download-artifact@v6 + with: + workflow: build.yml + name: mingw${{ matrix.arch }} + - name: Display help + run: > + $result = & lmms-*.exe "--help" | + Select-String "Usage: lmms"; + if($result.Matches.Count -eq 0) { exit 1 } + help-msvc: + strategy: + fail-fast: false + matrix: + arch: ['x86', 'x64'] + name: help-msvc-${{ matrix.arch }} + runs-on: windows-latest + steps: + - name: wait for build + uses: lewagon/wait-on-check-action@v1.3.4 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + check-name: msvc-${{ matrix.arch }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 30 + - name: Download workflow artifact + uses: dawidd6/action-download-artifact@v6 + with: + workflow: build.yml + name: msvc-${{ matrix.arch }} + - name: Display help + run: > + $result = & lmms-*.exe "--help" | + Select-String "Usage: lmms"; + if($result.Matches.Count -eq 0) { exit 1 }