Hide logging includes by limiting template use #54
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
# Build on new commits, tags, or pull requests. | |
create: | |
push: | |
pull_request: | |
schedule: | |
# Run every week just to make sure the CI environment still works. | |
- cron: '0 0 * * 0' | |
jobs: | |
build-ubuntu: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Apt Dependencies | |
run: sudo apt update && sudo apt install ninja-build qtbase5-dev qttools5-dev libboost-dev libboost-date-time-dev libboost-iostreams-dev nlohmann-json3-dev libasound2-dev librtmidi-dev libminizip-dev doctest-dev libfmt-dev | |
- name: Install Other Dependencies | |
run: vcpkg install pugixml | |
- name: Create Build Directory | |
run: cmake -E make_directory ${{runner.workspace}}/build | |
- name: Generate Project | |
working-directory: ${{runner.workspace}}/build | |
# We could use the -S and -B options, but we only have CMake 3.12 here. | |
run: cmake ${GITHUB_WORKSPACE} -G Ninja -DCMAKE_TOOLCHAIN_FILE="${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" | |
- name: Build | |
run: ninja -C ${{runner.workspace}}/build | |
- name: Test | |
run: ${{runner.workspace}}/build/bin/pte_tests | |
build-osx: | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Version number | |
id: version | |
run: echo "::set-output name=VERSION_ID::$(git describe --tags --long --always)" | |
- name: Install Dependencies | |
# CMake 3.17 is already installed | |
run: brew install boost doctest minizip ninja nlohmann-json pugixml qt5 pugixml rtmidi fmt | |
- name: Generate Project | |
run: cmake -S ${GITHUB_WORKSPACE} -B ${{runner.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5/lib/cmake | |
- name: Build | |
run: cmake --build ${{runner.workspace}}/build | |
- name: Test | |
run: ${{runner.workspace}}/build/bin/pte_tests | |
# Skip building the installer for PRs, since code signing / notarizing requires access to the repo's secrets. | |
- name: Add Certificates to Keychain | |
if: github.event_name != 'pull_request' | |
uses: apple-actions/import-codesign-certs@v2 | |
with: | |
p12-file-base64: ${{ secrets.MAC_CERTS_BASE64 }} | |
p12-password: ${{ secrets.MAC_CERTS_PASSWORD }} | |
- name: Build Installer | |
if: github.event_name != 'pull_request' | |
env: | |
MAC_DEV_PASSWORD: ${{ secrets.MAC_DEV_PASSWORD }} | |
run: cmake --build ${{runner.workspace}}/build --target package | |
- name: Upload Installer | |
if: github.event_name != 'pull_request' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: powertabeditor-osx-${{ steps.version.outputs.VERSION_ID }}.dmg | |
path: ${{runner.workspace}}/build/powertabeditor-osx.dmg | |
if-no-files-found: error | |
build-windows: | |
runs-on: windows-2022 | |
# Run both 32-bit and 64-bit builds. | |
strategy: | |
matrix: | |
arch: [x64, x86] | |
include: | |
- arch: x64 | |
cmake_arch: x64 | |
qt_arch: win64_msvc2019_64 | |
- arch: x86 | |
cmake_arch: Win32 | |
qt_arch: win32_msvc2019 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Version number | |
id: version | |
run: echo "::set-output name=VERSION_ID::$(git describe --tags --long --always)" | |
- name: Install Dependencies | |
run: vcpkg install --triplet ${{ matrix.arch }}-windows boost-algorithm boost-date-time boost-endian boost-functional boost-iostreams boost-range boost-rational boost-signals2 boost-stacktrace doctest minizip nlohmann-json pugixml fmt | |
# Building Qt via vcpkg would take a while ... | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
arch: ${{ matrix.qt_arch }} | |
version: 5.15.2 | |
- name: Generate Project | |
run: cmake -A ${{ matrix.cmake_arch }} -B ./build -DPTE_ENABLE_PCH=1 -DCMAKE_TOOLCHAIN_FILE="${env:VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" | |
- name: Build | |
run: cmake --build ./build --config Release | |
- name: Test | |
run: ./build/bin/pte_tests.exe | |
- name: Build Installer | |
run: | | |
choco install innosetup -y -v | |
iscc installer/windows/installer.iss | |
mv installer/windows/powertabeditor.exe installer/windows/powertabeditor-windows-${{ matrix.arch }}-${{ steps.version.outputs.VERSION_ID }}.exe | |
- name: Upload Installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: powertabeditor-windows-${{ matrix.arch }}-${{ steps.version.outputs.VERSION_ID }}.exe | |
path: installer/windows/powertabeditor-windows-${{ matrix.arch }}-${{ steps.version.outputs.VERSION_ID }}.exe | |
if-no-files-found: error |