Skip to content

CI: Unpack installers, test --help and --version #2245

CI: Unpack installers, test --help and --version

CI: Unpack installers, test --help and --version #2245

Workflow file for this run

---
name: build
'on': [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
name: linux
runs-on: ubuntu-latest
container: lmmsci/linux.gcc:18.04
env:
CMAKE_OPTS: >-
-DUSE_WERROR=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DUSE_COMPILE_CACHE=ON
CCACHE_MAXSIZE: 0
CCACHE_NOCOMPRESS: 1
MAKEFLAGS: -j2
steps:
- name: Update and configure Git
run: |
add-apt-repository ppa:git-core/ppa
apt-get update
apt-get --yes install git
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Cache ccache data
uses: actions/cache@v3
with:
key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
ccache-${{ github.job }}-${{ github.ref }}-
ccache-${{ github.job }}-
path: ~/.ccache
- name: Configure
run: |
ccache --zero-stats
source /opt/qt5*/bin/qt5*-env.sh || true
mkdir build && cd build
cmake .. $CMAKE_OPTS -DCMAKE_INSTALL_PREFIX=./install
- name: Build
run: cmake --build build
- name: Build tests
run: cmake --build build --target tests
- name: Run tests
run: build/tests/tests
- name: Package
run: |
cmake --build build --target install
cmake --build build --target appimage
- name: Display help
run: >
build/install/bin/lmms --help | grep "Usage: lmms"
- name: Display version
run: build/install/bin/lmms --version | grep "Copyright (c) .* LMMS Developers"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: linux
path: build/lmms-*.AppImage
- name: Trim ccache and print statistics
run: |
ccache --cleanup
echo "[ccache config]"
ccache --print-config
echo "[ccache stats]"
ccache --show-stats
env:
CCACHE_MAXSIZE: 500M
macos:
name: macos
runs-on: macos-12
env:
CMAKE_OPTS: >-
-DUSE_WERROR=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DUSE_COMPILE_CACHE=ON
CCACHE_MAXSIZE: 0
CCACHE_NOCOMPRESS: 1
MAKEFLAGS: -j3
DEVELOPER_DIR: /Applications/Xcode_13.1.app/Contents/Developer
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Clean up Homebrew download cache
run: rm -rf ~/Library/Caches/Homebrew/downloads
- name: Restore Homebrew download cache
uses: actions/cache/restore@v3
with:
key: n/a - only restore from restore-keys
restore-keys: |
homebrew-
path: ~/Library/Caches/Homebrew/downloads
- name: Cache ccache data
uses: actions/cache@v3
with:
key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
ccache-${{ github.job }}-${{ github.ref }}-
ccache-${{ github.job }}-
path: ~/Library/Caches/ccache
- name: Install dependencies
run: |
brew bundle install --verbose
npm update -g npm
npm install --location=global appdmg
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_UPGRADE: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
- name: Configure
run: |
ccache --zero-stats
mkdir build
cmake -S . \
-B build \
-DCMAKE_INSTALL_PREFIX="../target" \
-DCMAKE_PREFIX_PATH="$(brew --prefix qt5)" \
$CMAKE_OPTS \
-DUSE_WERROR=OFF
- name: Build
run: cmake --build build
- name: Build tests
run: cmake --build build --target tests
- name: Run tests
run: build/tests/tests
- name: Package
run: |
cmake --build build --target install
cmake --build build --target dmg
- name: Display help
run: >
build/LMMS.app/Contents/MacOS/lmms --help | grep "Usage: lmms"
- name: Display version
run: build/LMMS.app/Contents/MacOS/lmms --version | grep "Copyright (c) .* LMMS Developers"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: macos
path: build/lmms-*.dmg
- name: Trim ccache and print statistics
run: |
ccache --cleanup
echo "[ccache config]"
ccache --show-config
echo "[ccache stats]"
ccache --show-stats --verbose
env:
CCACHE_MAXSIZE: 500MB
- name: Save Homebrew download cache
uses: actions/cache/save@v3
with:
key: homebrew-${{ hashFiles('Brewfile.lock.json') }}
path: ~/Library/Caches/Homebrew/downloads
mingw:
strategy:
fail-fast: false
matrix:
arch: ['32', '64']
name: mingw${{ matrix.arch }}
runs-on: ubuntu-latest
container: lmmsci/linux.mingw${{ matrix.arch }}:18.04
env:
CMAKE_OPTS: >-
-DUSE_WERROR=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DUSE_COMPILE_CACHE=ON
CCACHE_MAXSIZE: 0
CCACHE_NOCOMPRESS: 1
MAKEFLAGS: -j2
steps:
- name: Update and configure Git
run: |
add-apt-repository ppa:git-core/ppa
apt-get update
apt-get --yes install git wine-stable p7zip-full
dpkg --add-architecture i386 # add i386 arch for wine32
apt-get --yes update
apt-get --yes install wine32
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Cache ccache data
uses: actions/cache@v3
with:
key: "ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}\
-${{ github.run_id }}"
restore-keys: |
ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}-
ccache-${{ github.job }}-${{ matrix.arch }}-
path: ~/.ccache
- name: Configure
run: |
ccache --zero-stats
mkdir build && cd build
../cmake/build_win${{ matrix.arch }}.sh
- name: Build
run: cmake --build build
- name: Build tests
run: cmake --build build --target tests
- name: Package
run: cmake --build build --target package
- name: Unpack
run: |
mkdir build/install
7z x -obuild/install build/lmms-*.exe
- name: Display help
run: >
WINEPREFIX=/tmp/lmms-wineprefix
wine "build/install/lmms.exe" --help |
grep "Usage: lmms"
- name: Display version
run: >
WINEPREFIX=/tmp/lmms-wineprefix
wine "build/install/lmms.exe" --version |
grep "Copyright (c) .* LMMS Developers"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: mingw${{ matrix.arch }}
path: build/lmms-*.exe
- name: Trim ccache and print statistics
run: |
ccache --cleanup
echo "[ccache config]"
ccache --print-config
echo "[ccache stats]"
ccache --show-stats
env:
CCACHE_MAXSIZE: 500M
msvc:
strategy:
fail-fast: false
matrix:
config:
- arch: 'x86'
programfiles-suffix: '(x86)'
- arch: 'x64'
programfiles-suffix: ''
name: msvc-${{ matrix.config.arch }}
runs-on: windows-2019
env:
qt-version: '5.15.2'
CCACHE_MAXSIZE: 0
CCACHE_NOCOMPRESS: 1
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Cache vcpkg dependencies
id: cache-deps
uses: actions/cache@v3
with:
key: vcpkg-${{ matrix.config.arch }}-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-${{ matrix.config.arch }}-
path: build\vcpkg_installed
- name: Cache ccache data
uses: actions/cache@v3
with:
# yamllint disable rule:line-length
key: "ccache-${{ github.job }}-${{ matrix.config.arch }}-${{ github.ref }}\
-${{ github.run_id }}"
restore-keys: |
ccache-${{ github.job }}-${{ matrix.config.arch }}-${{ github.ref }}-
ccache-${{ github.job }}-${{ matrix.config.arch }}-
path: ~\AppData\Local\ccache
# yamllint enable rule:line-length
- name: Install tools
run: choco install ccache
- name: Install 64-bit Qt
if: matrix.config.arch == 'x64'
uses: jurplel/install-qt-action@b3ea5275e37b734d027040e2c7fe7a10ea2ef946
with:
version: ${{ env.qt-version }}
arch: win64_msvc2019_64
archives: qtbase qtsvg qttools
cache: true
- name: Install 32-bit Qt
uses: jurplel/install-qt-action@b3ea5275e37b734d027040e2c7fe7a10ea2ef946
with:
version: ${{ env.qt-version }}
arch: win32_msvc2019
archives: qtbase qtsvg qttools
cache: true
set-env: ${{ matrix.config.arch == 'x86' }}
- name: Set up build environment
uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89
with:
arch: ${{ matrix.config.arch }}
- name: Configure
run: |
ccache --zero-stats
mkdir build -Force
cmake -S . `
-B build `
-G Ninja `
--toolchain C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DUSE_COMPILE_CACHE=ON `
-DVCPKG_TARGET_TRIPLET="${{ matrix.config.arch }}-windows" `
-DVCPKG_HOST_TRIPLET="${{ matrix.config.arch }}-windows" `
-DVCPKG_MANIFEST_INSTALL="${{ env.should_install_manifest }}"
env:
should_install_manifest:
${{ steps.cache-deps.outputs.cache-hit == 'true' && 'NO' || 'YES' }}
- name: Build
run: cmake --build build
- name: Build tests
run: cmake --build build --target tests
- name: Package
run: cmake --build build --target package
- name: Unpack
run: Start-Process @(gci build/lmms-*.exe)[0] -ArgumentList /S -Wait
# yamllint disable rule:line-length
- name: Display help
run: >
$result = & "${env:ProgramFiles${{ matrix.config.programfiles-suffix }}}/LMMS/lmms.exe" "--help" |
Select-String "Usage: lmms";
if($result.Matches.Count -eq 0) { exit 1 }
- name: Display version
run: >
$result = & "${env:ProgramFiles${{ matrix.config.programfiles-suffix }}}/LMMS/lmms.exe" "--version" |
Select-String -Pattern "Copyright \(c\) .* LMMS Developers";
if($result.Matches.Count -eq 0) { exit 1 }
# yamllint enable rule:line-length
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: msvc-${{ matrix.config.arch }}
path: build\lmms-*.exe
- name: Trim ccache and print statistics
run: |
ccache --cleanup
echo "[ccache config]"
ccache --show-config
echo "[ccache stats]"
ccache --show-stats --verbose
env:
CCACHE_MAXSIZE: 500MB