Add optional dependencies to windows and macos targets in build-tests.yml (#229)

Install and validate integration with as many optional dependencies on all testing platforms when doing CI build tests.

- For windows-latest, use vcpkg to install zlib, libqrencode, and zint.
- For macos-latest, use brew to install zlib, qrencode, and zint.
- Made zint version detection more robust across platforms.
This commit is contained in:
Jaye Evins
2025-09-10 23:27:03 -04:00
committed by GitHub
parent 3bd78558b3
commit 9e4d18c789
2 changed files with 43 additions and 7 deletions
+28 -5
View File
@@ -6,16 +6,12 @@
# - windows-latest - cl
# - macos-latest - clang
#
# TODO:
# - install optional dependencies for windows-latest and macos-latest
name: Multi-Platform Build Tests
on:
push:
pull_request:
branches: [ master ]
jobs:
build:
@@ -66,24 +62,50 @@ jobs:
# install zint-2.15.0 from source
wget https://downloads.sourceforge.net/project/zint/zint/2.15.0/zint-2.15.0-src.tar.gz && tar xzf zint-2.15.0-src.tar.gz && ( cd zint-2.15.0-src && mkdir build && cd build && cmake .. && make && sudo make install )
- name: Pre-install vcpkg (Windows)
if: startsWith( matrix.os, 'windows-' )
shell: bash
run: |
git clone --depth 1 https://github.com/microsoft/vcpkg.git
- name: Restore vcpkg cache (Windows)
if: startsWith(matrix.os, 'windows-')
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/vcpkg/installed
${{ github.workspace }}/vcpkg/downloads
key: vcpkg-${{ runner.os }}-${{ hashFiles('.github/workflows/build-tests.yml') }}
restore-keys: |
vcpkg-${{ runner.os }}-
- name: Install optional dependencies (Windows)
if: startsWith( matrix.os, 'windows-' )
shell: bash
run: |
# install packages
./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg install pkgconf
./vcpkg/vcpkg install zlib
./vcpkg/vcpkg install libqrencode
./vcpkg/vcpkg install zint
echo "TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV
- name: Install optional dependencies (MacOS)
if: startsWith( matrix.os, 'macos-' )
shell: bash
run: |
# install packages
brew install zlib
brew install qrencode
brew install zint
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.2.*'
install-deps: 'true'
archives: 'qtbase qtsvg qttools icu'
archives: 'qtbase qtsvg qttools icu qttranslations'
- name: Set reusable strings
id: strings
@@ -97,6 +119,7 @@ jobs:
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_TOOLCHAIN_FILE=${{ env.TOOLCHAIN_FILE }}
-S ${{ github.workspace }}
- name: Build