Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 42 additions & 14 deletions .github/workflows/_build-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
qt_version:
required: true
type: string
build_types_bash:
description: Bash array literal of CMake build configurations to process sequentially.
required: true
type: string
qt_arch: # get rid of this, eventually, by detecting the correct Qt architecture based on the OS and compiler-
description: Qt architecture passed to jurplel/install-qt-action (e.g. clang_64 for macOS Intel).
required: false
Expand All @@ -38,7 +42,7 @@ jobs:
- name: Set reusable strings
id: strings
shell: bash
run: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
run: echo "build-root-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Set up environment
if: ${{ inputs.setup_env_script }}
Expand All @@ -53,18 +57,42 @@ jobs:
install-deps: 'true'
set-env: 'true'

- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_C_COMPILER=${{ inputs.c_compiler }}
-DCMAKE_CXX_COMPILER=${{ inputs.cpp_compiler }}
-DCMAKE_BUILD_TYPE=Release
${{ steps.strings.outputs.osx_arch_flag }}
-S ${{ github.workspace }}
- name: Configure requested configurations
shell: bash
run: |
build_types=${{ inputs.build_types_bash }}

for build_type in "${build_types[@]}"; do
build_dir="${{ steps.strings.outputs.build-root-dir }}/$(printf '%s' "$build_type" | tr '[:upper:]' '[:lower:]')"

echo "Configuring ${build_type} in ${build_dir}"
cmake -B "$build_dir" \
-DCMAKE_C_COMPILER="${{ inputs.c_compiler }}" \
-DCMAKE_CXX_COMPILER="${{ inputs.cpp_compiler }}" \
-DCMAKE_BUILD_TYPE="$build_type" \
-S "${{ github.workspace }}"
done

- name: Build requested configurations
shell: bash
run: |
build_types=${{ inputs.build_types_bash }}

for build_type in "${build_types[@]}"; do
build_dir="${{ steps.strings.outputs.build-root-dir }}/$(printf '%s' "$build_type" | tr '[:upper:]' '[:lower:]')"

echo "Building ${build_type}"
cmake --build "$build_dir" --config "$build_type"
done

- name: Test requested configurations
shell: bash
run: |
build_types=${{ inputs.build_types_bash }}

- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release
for build_type in "${build_types[@]}"; do
build_dir="${{ steps.strings.outputs.build-root-dir }}/$(printf '%s' "$build_type" | tr '[:upper:]' '[:lower:]')"

- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config Release
echo "Testing ${build_type}"
ctest --test-dir "$build_dir" --build-config "$build_type"
done
3 changes: 3 additions & 0 deletions .github/workflows/_matrix-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
# lowest LTS version that we can get through aqt is 5.9, so we start from there
# that's the reason why "5.6.*" is not included
value: '["5.9.*", "5.12.*", "5.15.*", "6.2.*", "6.5.*", "6.8.*"]'
build_types_bash:
description: "Bash array literal of CMake build configurations to process sequentially in each CI job"
value: '("Debug" "RelWithDebInfo")'
compilers_linux:
description: "Compilers for Linux"
value: '["gcc", "clang"]'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ jobs:
c_compiler: ${{ matrix.c_compiler }}
cpp_compiler: ${{ matrix.cpp_compiler }}
qt_version: ${{ matrix.qt_version }}
build_types_bash: ${{ needs.get-matrix.outputs.build_types_bash }}
2 changes: 2 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
c_compiler: ${{ matrix.c_compiler }}
cpp_compiler: ${{ matrix.cpp_compiler }}
qt_version: ${{ matrix.qt_version }}
build_types_bash: ${{ needs.get-matrix.outputs.build_types_bash }}
qt_arch: clang_64 # x86_64 Qt binary for Intel cross-compilation
setup_env_script: |
# Install Rosetta 2 so x86_64 test binaries can run on the ARM64 runner.
Expand Down Expand Up @@ -69,3 +70,4 @@ jobs:
c_compiler: ${{ matrix.c_compiler }}
cpp_compiler: ${{ matrix.cpp_compiler }}
qt_version: ${{ matrix.qt_version }}
build_types_bash: ${{ needs.get-matrix.outputs.build_types_bash }}
1 change: 1 addition & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ jobs:
c_compiler: ${{ matrix.c_compiler }}
cpp_compiler: ${{ matrix.cpp_compiler }}
qt_version: ${{ matrix.qt_version }}
build_types_bash: ${{ needs.get-matrix.outputs.build_types_bash }}
Loading