Skip to content

Commit

Permalink
Update Github Actions
Browse files Browse the repository at this point in the history
* Update all builds to use multi-line syntax for CMake configuration
  commands
* Update all non-release builds to disable Qt when not installed. This
  ensures that C-only builds, when the C++ compiler may be absent, still
  work.
* Update Ubuntu and Fedora builds to set CMAKE_REQUIRE_FIND_PACKAGE_tr31
  using a Github Actions expression instead of an environment variable
* Update MacOS builds to test shared library builds
* Update Windows builds to test Qt5 and Qt6 builds regardless of
  architecture. Qt5 builds were no longer tested after i686 builds were
  removed.
* Only test Qt6 for clang64 because Qt5's windeployqt does not support
  clang64
  • Loading branch information
leonlynch committed Sep 17, 2024
1 parent 8035a93 commit a0f254c
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 38 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/fedora-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,18 @@ jobs:
- name: Install build tools and MbedTLS
run: sudo dnf -y install git gh cmake gcc mbedtls-devel

- name: Install Qt5
if: contains(matrix.deps, 'qt')
run: sudo dnf -y install qt5-qtbase-devel

- name: Install TR-31 release
if: contains(matrix.deps, 'tr31')
run: |
gh release download --repo openemv/tr31 ${{ env.TR31_VERSION }}
sudo dnf -y install tr31-${{ env.TR31_VERSION }}-1.fc${{ matrix.fedora_version }}.x86_64.rpm
echo "CMAKE_REQUIRE_FIND_PACKAGE_tr31=YES" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Qt5
if: contains(matrix.deps, 'qt')
run: sudo dnf -y install qt5-qtbase-devel

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -57,7 +56,12 @@ jobs:
git describe --always --dirty
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_REQUIRE_FIND_PACKAGE_tr31=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_tr31 }} -DBUILD_DUKPT_UI=${{ matrix.build_dukpt_ui }}
run: |
cmake -B build -DCMAKE_BUILD_TYPE="Debug" \
-DCMAKE_REQUIRE_FIND_PACKAGE_tr31=${{ contains(matrix.deps, 'tr31') && 'YES' || 'NO' }} \
-DCMAKE_DISABLE_FIND_PACKAGE_Qt5=${{ !contains(matrix.deps, 'qt') && 'YES' || 'NO' }} \
-DCMAKE_DISABLE_FIND_PACKAGE_Qt6=${{ !contains(matrix.deps, 'qt') && 'YES' || 'NO' }} \
-DBUILD_DUKPT_UI=${{ matrix.build_dukpt_ui }}
- name: Build
run: cmake --build build
Expand Down Expand Up @@ -107,7 +111,14 @@ jobs:
run: echo "GIT_DESCRIBE=$(git describe --always --dirty)" >> $GITHUB_ENV

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=YES -DBUILD_DOCS=YES -DBUILD_DUKPT_UI=YES -DCPACK_COMPONENTS_GROUPING=ALL_COMPONENTS_IN_ONE
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=YES \
-DBUILD_DOCS=YES \
-DBUILD_DUKPT_UI=YES \
-DCPACK_COMPONENTS_GROUPING=ALL_COMPONENTS_IN_ONE
- name: Build
run: cmake --build build
Expand Down
47 changes: 35 additions & 12 deletions .github/workflows/macos-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ jobs:
fail-fast: false
matrix:
include:
- { name: "MacOS 13", os: macos-13, osx_arch: "x86_64;arm64", build_type: "Release", deps: "none", fetch_deps: YES, build_dukpt_ui: NO }
- { name: "MacOS 13", os: macos-13, osx_arch: "x86_64;arm64", build_type: "Debug", deps: "tr31", fetch_deps: YES, build_dukpt_ui: NO }
- { name: "MacOS 13", os: macos-13, osx_arch: "x86_64", build_type: "Debug", deps: "tr31/qt5", fetch_deps: NO, build_dukpt_ui: YES }
- { name: "MacOS 13", os: macos-13, osx_arch: "x86_64", build_type: "Release", deps: "tr31/qt6", fetch_deps: NO, build_dukpt_ui: YES }
- { name: "MacOS 14", os: macos-14, osx_arch: "arm64", build_type: "Release", deps: "tr31", fetch_deps: NO, build_dukpt_ui: NO }
- { name: "MacOS 14", os: macos-14, osx_arch: "arm64", build_type: "Debug", deps: "tr31/qt5", fetch_deps: YES, build_dukpt_ui: YES }
- { name: "MacOS 14", os: macos-14, osx_arch: "arm64", build_type: "Debug", deps: "tr31/qt6", fetch_deps: YES, build_dukpt_ui: YES }

name: ${{ matrix.name }} (${{ matrix.osx_arch }}) build (static/${{ matrix.build_type }}/${{ matrix.deps }})
- { name: "MacOS 13", os: macos-13, osx_arch: "x86_64;arm64", build_type: "Release", lib_type: "shared", shared_libs: "YES", deps: "none", fetch_deps: YES, build_dukpt_ui: NO }
- { name: "MacOS 13", os: macos-13, osx_arch: "x86_64;arm64", build_type: "Debug", lib_type: "static", shared_libs: "NO", deps: "tr31", fetch_deps: YES, build_dukpt_ui: NO }
- { name: "MacOS 13", os: macos-13, osx_arch: "x86_64", build_type: "Debug", lib_type: "shared", shared_libs: "YES", deps: "tr31/qt5", fetch_deps: NO, build_dukpt_ui: YES }
- { name: "MacOS 13", os: macos-13, osx_arch: "x86_64", build_type: "Release", lib_type: "static", shared_libs: "NO", deps: "tr31/qt6", fetch_deps: NO, build_dukpt_ui: YES }
- { name: "MacOS 14", os: macos-14, osx_arch: "arm64", build_type: "Release", lib_type: "shared", shared_libs: "YES", deps: "tr31", fetch_deps: NO, build_dukpt_ui: NO }
- { name: "MacOS 14", os: macos-14, osx_arch: "arm64", build_type: "Debug", lib_type: "static", shared_libs: "NO", deps: "tr31/qt5", fetch_deps: YES, build_dukpt_ui: YES }
- { name: "MacOS 14", os: macos-14, osx_arch: "arm64", build_type: "Debug", lib_type: "shared", shared_libs: "YES", deps: "tr31/qt6", fetch_deps: YES, build_dukpt_ui: YES }

name: ${{ matrix.name }} (${{ matrix.osx_arch }}) build (${{ matrix.lib_type }}/${{ matrix.build_type }}/${{ matrix.deps }})
runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
gh release download --repo openemv/tr31 ${{ env.TR31_VERSION }}
tar xvfz tr31-${{ env.TR31_VERSION }}-src.tar.gz
cd tr31-${{ env.TR31_VERSION }}
cmake -B build -DCMAKE_OSX_ARCHITECTURES="${{ matrix.osx_arch }}" -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" -DFETCH_MBEDTLS=${{ matrix.fetch_deps }} -DCMAKE_REQUIRE_FIND_PACKAGE_MbedTLS=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_MbedTLS }} -DBUILD_TR31_TOOL=NO
cmake -B build -DCMAKE_OSX_ARCHITECTURES="${{ matrix.osx_arch }}" -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" -DBUILD_SHARED_LIBS=${{ matrix.shared_libs }} -DFETCH_MBEDTLS=${{ matrix.fetch_deps }} -DCMAKE_REQUIRE_FIND_PACKAGE_MbedTLS=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_MbedTLS }} -DBUILD_TR31_TOOL=NO
cmake --build build
echo "TR31_DIR=$(pwd)/build/cmake/" >> $GITHUB_ENV
echo "CMAKE_REQUIRE_FIND_PACKAGE_tr31=YES" >> $GITHUB_ENV
Expand All @@ -79,7 +79,20 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Configure CMake
run: cmake -B build -DCMAKE_OSX_ARCHITECTURES="${{ matrix.osx_arch }}" -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" -DFETCH_MBEDTLS=${{ matrix.fetch_deps }} -DCMAKE_REQUIRE_FIND_PACKAGE_MbedTLS=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_MbedTLS }} -DFETCH_ARGP=${{ matrix.fetch_deps }} -Dtr31_DIR=${{ env.TR31_DIR }} -DCMAKE_REQUIRE_FIND_PACKAGE_tr31=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_tr31 }} -DQT_DIR=${{ env.QT_DIR }} -DBUILD_DUKPT_UI=${{ matrix.build_dukpt_ui }}
run: |
cmake -B build \
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.osx_arch }}" \
-DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" \
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs }} \
-DFETCH_MBEDTLS=${{ matrix.fetch_deps }} \
-DCMAKE_REQUIRE_FIND_PACKAGE_MbedTLS=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_MbedTLS }} \
-DFETCH_ARGP=${{ matrix.fetch_deps }} \
-Dtr31_DIR=${{ env.TR31_DIR }} \
-DCMAKE_REQUIRE_FIND_PACKAGE_tr31=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_tr31 }} \
-DQT_DIR=${{ env.QT_DIR }} \
-DCMAKE_DISABLE_FIND_PACKAGE_Qt5=${{ !contains(matrix.deps, 'qt5') && 'YES' || 'NO' }} \
-DCMAKE_DISABLE_FIND_PACKAGE_Qt6=${{ !contains(matrix.deps, 'qt6') && 'YES' || 'NO' }} \
-DBUILD_DUKPT_UI=${{ matrix.build_dukpt_ui }}
- name: Build
run: cmake --build build
Expand Down Expand Up @@ -126,7 +139,17 @@ jobs:
run: scripts/prepare_macos_keychain.sh

- name: Configure CMake
run: cmake -B build -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DFETCH_MBEDTLS=YES -DFETCH_ARGP=YES -Dtr31_DIR=${{ env.TR31_DIR }} -DQT_DIR=${{ env.QT_DIR }} -DBUILD_DUKPT_UI=YES -DBUILD_MACOSX_BUNDLE=YES -DSIGN_MACOSX_BUNDLE=openemv.org
run: |
cmake -B build \
-DCMAKE_OSX_ARCHITECTURES="x86_64" \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DFETCH_MBEDTLS=YES \
-DFETCH_ARGP=YES \
-Dtr31_DIR=${{ env.TR31_DIR }} \
-DQT_DIR=${{ env.QT_DIR }} \
-DBUILD_DUKPT_UI=YES \
-DBUILD_MACOSX_BUNDLE=YES \
-DSIGN_MACOSX_BUNDLE=openemv.org
- name: Build
run: cmake --build build
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/ubuntu-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,33 @@ jobs:
sudo apt-get update
sudo apt-get install -y libmbedtls-dev
- name: Install Qt5
if: contains(matrix.deps, 'qt')
run: sudo apt-get install -y qtbase5-dev

- name: Install TR-31 release
if: contains(matrix.deps, 'tr31')
run: |
gh release download --repo openemv/tr31 ${{ env.TR31_VERSION }}
unzip tr31-${{ env.TR31_VERSION }}-${{ matrix.os }}.zip
sudo dpkg -i tr31_${{ env.TR31_VERSION }}-0ubuntu1~ppa1~${{ matrix.ubuntu_release_name }}1_amd64.deb
echo "CMAKE_REQUIRE_FIND_PACKAGE_tr31=YES" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Qt5
if: contains(matrix.deps, 'qt')
run: sudo apt-get install -y qtbase5-dev

- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- run: git describe --always --dirty

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_REQUIRE_FIND_PACKAGE_tr31=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_tr31 }} -DBUILD_DUKPT_UI=${{ matrix.build_dukpt_ui }}
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE="Debug" \
-DCMAKE_REQUIRE_FIND_PACKAGE_tr31=${{ contains(matrix.deps, 'tr31') && 'YES' || 'NO' }} \
-DCMAKE_DISABLE_FIND_PACKAGE_Qt5=${{ !contains(matrix.deps, 'qt') && 'YES' || 'NO' }} \
-DCMAKE_DISABLE_FIND_PACKAGE_Qt6=${{ !contains(matrix.deps, 'qt') && 'YES' || 'NO' }} \
-DBUILD_DUKPT_UI=${{ matrix.build_dukpt_ui }}
- name: Build
run: cmake --build build
Expand Down Expand Up @@ -101,7 +106,15 @@ jobs:
# intended Ubuntu release. The ppa1 component indicates that this is not
# an official Ubuntu package. The release name component indicates that
# this is for the specific Ubuntu release that has that name.
run: cmake -B build -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=YES -DBUILD_DOCS=YES -DBUILD_DUKPT_UI=YES -DCPACK_COMPONENTS_GROUPING=ALL_COMPONENTS_IN_ONE -DCPACK_DEBIAN_PACKAGE_RELEASE="0ubuntu1~ppa1~${{ matrix.ubuntu_release_name }}1"
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=YES \
-DBUILD_DOCS=YES \
-DBUILD_DUKPT_UI=YES \
-DCPACK_COMPONENTS_GROUPING=ALL_COMPONENTS_IN_ONE \
-DCPACK_DEBIAN_PACKAGE_RELEASE="0ubuntu1~ppa1~${{ matrix.ubuntu_release_name }}1"
- name: Build
run: cmake --build build
Expand Down
41 changes: 29 additions & 12 deletions .github/workflows/windows-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ jobs:
matrix:
include:
- { sys: mingw64, env: x86_64, build_type: "Release", lib_type: "static", shared_libs: "NO", deps: "none", fetch_deps: NO, build_dukpt_ui: NO }
- { sys: mingw64, env: x86_64, build_type: "Debug", lib_type: "dll", shared_libs: "YES", deps: "tr31/qt", fetch_deps: NO, build_dukpt_ui: YES }
- { sys: mingw64, env: x86_64, build_type: "Release", lib_type: "static", shared_libs: "NO", deps: "tr31/qt", fetch_deps: YES, build_dukpt_ui: YES }
- { sys: ucrt64, env: ucrt-x86_64, build_type: "Debug", lib_type: "static", shared_libs: "NO", deps: "tr31/qt", fetch_deps: NO, build_dukpt_ui: YES }
- { sys: ucrt64, env: ucrt-x86_64, build_type: "Release", lib_type: "dll", shared_libs: "YES", deps: "tr31/qt", fetch_deps: YES, build_dukpt_ui: YES }
- { sys: clang64, env: clang-x86_64, build_type: "Debug", lib_type: "dll", shared_libs: "YES", deps: "tr31/qt", fetch_deps: NO, build_dukpt_ui: YES }
- { sys: clang64, env: clang-x86_64, build_type: "Release", lib_type: "static", shared_libs: "NO", deps: "tr31/qt", fetch_deps: YES, build_dukpt_ui: YES }
- { sys: mingw64, env: x86_64, build_type: "Debug", lib_type: "dll", shared_libs: "YES", deps: "tr31/qt6", fetch_deps: NO, build_dukpt_ui: YES }
- { sys: mingw64, env: x86_64, build_type: "Release", lib_type: "static", shared_libs: "NO", deps: "tr31/qt5", fetch_deps: YES, build_dukpt_ui: YES }
- { sys: ucrt64, env: ucrt-x86_64, build_type: "Debug", lib_type: "static", shared_libs: "NO", deps: "tr31/qt5", fetch_deps: NO, build_dukpt_ui: YES }
- { sys: ucrt64, env: ucrt-x86_64, build_type: "Release", lib_type: "dll", shared_libs: "YES", deps: "tr31/qt6", fetch_deps: YES, build_dukpt_ui: YES }
# NOTE: Only test Qt6 for clang64 because Qt5's windeployqt does not support clang64
- { sys: clang64, env: clang-x86_64, build_type: "Debug", lib_type: "dll", shared_libs: "YES", deps: "tr31/qt6", fetch_deps: NO, build_dukpt_ui: YES }
- { sys: clang64, env: clang-x86_64, build_type: "Release", lib_type: "static", shared_libs: "NO", deps: "tr31/qt6", fetch_deps: YES, build_dukpt_ui: YES }

name: Windows MSYS2 ${{matrix.sys}} build (${{ matrix.lib_type }}/${{ matrix.build_type }}/${{ matrix.deps }})

Expand Down Expand Up @@ -60,14 +61,12 @@ jobs:
echo "CMAKE_REQUIRE_FIND_PACKAGE_MbedTLS=YES" >> $GITHUB_ENV
- name: Install Qt5
# MSYS2 doesn't support Qt6 for i686
if: ${{ contains(matrix.deps, 'qt') && matrix.env == 'i686' }}
if: contains(matrix.deps, 'qt5')
run: |
pacman --noconfirm -S --needed mingw-w64-${{matrix.env}}-qt5-base mingw-w64-${{matrix.env}}-qt5-tools
- name: Install Qt6
# MSYS2 doesn't support Qt6 for i686
if: ${{ contains(matrix.deps, 'qt') && matrix.env != 'i686' }}
if: contains(matrix.deps, 'qt6')
run: |
pacman --noconfirm -S --needed mingw-w64-${{matrix.env}}-qt6-base mingw-w64-${{matrix.env}}-qt6-tools
Expand All @@ -92,7 +91,18 @@ jobs:
git describe --always --dirty
- name: Configure CMake
run: cmake -G Ninja -B build -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" -DBUILD_SHARED_LIBS=${{ matrix.shared_libs }} -DFETCH_MBEDTLS=${{ matrix.fetch_deps }} -DCMAKE_REQUIRE_FIND_PACKAGE_MbedTLS=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_MbedTLS }} -DFETCH_ARGP=YES -Dtr31_DIR=${{ env.TR31_DIR }} -DCMAKE_REQUIRE_FIND_PACKAGE_tr31=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_tr31 }} -DBUILD_DUKPT_UI=${{ matrix.build_dukpt_ui }}
run: |
cmake -G Ninja -B build \
-DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" \
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs }} \
-DFETCH_MBEDTLS=${{ matrix.fetch_deps }} \
-DCMAKE_REQUIRE_FIND_PACKAGE_MbedTLS=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_MbedTLS }} \
-DFETCH_ARGP=YES \
-Dtr31_DIR=${{ env.TR31_DIR }} \
-DCMAKE_REQUIRE_FIND_PACKAGE_tr31=${{ env.CMAKE_REQUIRE_FIND_PACKAGE_tr31 }} \
-DCMAKE_DISABLE_FIND_PACKAGE_Qt5=${{ !contains(matrix.deps, 'qt5') && 'YES' || 'NO' }} \
-DCMAKE_DISABLE_FIND_PACKAGE_Qt6=${{ !contains(matrix.deps, 'qt6') && 'YES' || 'NO' }} \
-DBUILD_DUKPT_UI=${{ matrix.build_dukpt_ui }}
- name: Build
run: cmake --build build
Expand Down Expand Up @@ -165,7 +175,14 @@ jobs:
echo "GIT_DESCRIBE=$(git describe --always --dirty)" >> $GITHUB_ENV
- name: Configure CMake
run: cmake -G Ninja -B build -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" -DBUILD_SHARED_LIBS=YES -DFETCH_MBEDTLS=YES -DFETCH_ARGP=YES -DBUILD_DUKPT_UI=YES -Dtr31_DIR=${{ env.TR31_DIR }}
run: |
cmake -G Ninja -B build \
-DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" \
-DBUILD_SHARED_LIBS=YES \
-DFETCH_MBEDTLS=YES \
-DFETCH_ARGP=YES \
-Dtr31_DIR=${{ env.TR31_DIR }} \
-DBUILD_DUKPT_UI=YES
# CMake will only accept Windows paths if they are environment variables, not CMake command line cache entries
env:
CMAKE_PREFIX_PATH: ${{ env.Qt6_DIR }}
Expand Down

0 comments on commit a0f254c

Please sign in to comment.