Update cmake-multi-platform.yml #12
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: CMake on multiple platforms | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
build_type: [Release] | |
c_compiler: [clang, cl] | |
include: | |
- os: windows-latest | |
c_compiler: cl | |
cpp_compiler: cl | |
- os: ubuntu-latest | |
c_compiler: clang | |
cpp_compiler: clang++ | |
exclude: | |
- os: windows-latest | |
c_compiler: clang | |
- os: ubuntu-latest | |
c_compiler: cl | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- name: Set reusable strings | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
# Pinning the aqt version is optional; you can remove or adjust as needed | |
# aqtversion: '==3.1.*' | |
version: '6.5.3' | |
# For Qt6, we typically specify modules instead of archives | |
modules: 'qtserialport' | |
- name: Configure CMake | |
run: > | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | |
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
-S ${{ github.workspace }} | |
- name: Build | |
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v4.3.1 | |
with: | |
name: QMamehook-${{ matrix.os }} | |
path: build | |
- name: Download a Build Artifact | |
uses: actions/download-artifact@v4.1.2 | |
with: | |
name: QMamehook-${{ matrix.os }} | |
# - name: Test | |
# working-directory: ${{ steps.strings.outputs.build-output-dir }} | |
# run: ctest --build-config ${{ matrix.build_type }} |