From 173e6203461f922b3a0ea3c10b26d3b6692ebd87 Mon Sep 17 00:00:00 2001 From: Nils Schimmelmann Date: Fri, 6 Dec 2024 19:49:15 -0800 Subject: [PATCH] fix CI build (#358) * upgrade to Ubuntu 24.04 * enable MinGW GCC 13 builds * switch to Chocolatey OpenSSL --- .appveyor.yml | 2 +- .github/workflows/build-test.yml | 60 ++++++++++++++++++++++---------- 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 7829a5db..4bf274d8 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -347,7 +347,7 @@ for: install: - ps: $env:package_version = ("$(git describe --tags --always --long)").trim() - ps: Update-AppveyorBuild -Version "$env:package_version-$env:APPVEYOR_BUILD_NUMBER" - - brew install openssl@1.1 qt5 miniupnpc + - HOMEBREW_NO_AUTO_UPDATE=1 brew install openssl@1.1 qt5 miniupnpc - export PATH=/usr/local/opt/qt@5/bin:$PATH build_script: diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 7805039d..f4ed992f 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -14,10 +14,10 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2022, macos-latest, ubuntu-22.04] + os: [windows-2022, macos-latest, ubuntu-24.04] compiler: ['clang', 'gcc', 'msvc'] exclude: - - os: ubuntu-22.04 + - os: ubuntu-24.04 compiler: 'msvc' - os: macos-latest compiler: 'gcc' @@ -25,8 +25,6 @@ jobs: compiler: 'msvc' - os: windows-2022 compiler: 'clang' - - os: windows-2022 - compiler: 'gcc' steps: - uses: actions/checkout@v4 with: @@ -47,19 +45,19 @@ jobs: - if: contains( matrix.os, 'ubuntu' ) && matrix.compiler == 'gcc' name: Install GCC for Ubuntu run: | - sudo apt install -y gcc-11 g++-11 lcov + sudo apt install -y gcc-13 g++-13 lcov echo "QMAKESPEC=linux-g++" >> $GITHUB_ENV - echo "CC=gcc-11" >> $GITHUB_ENV - echo "CXX=g++-11" >> $GITHUB_ENV + echo "CC=gcc-13" >> $GITHUB_ENV + echo "CXX=g++-13" >> $GITHUB_ENV echo "MMAPPER_CMAKE_EXTRA=-DUSE_CODE_COVERAGE=true" >> $GITHUB_ENV echo "COVERAGE=true" >> $GITHUB_ENV - if: contains( matrix.os, 'ubuntu' ) && matrix.compiler == 'clang' name: Install Clang for Ubuntu run: | - sudo apt install -y clang-13 binutils + sudo apt install -y clang-18 binutils echo "QMAKESPEC=linux-clang" >> $GITHUB_ENV - echo "CC=clang-13" >> $GITHUB_ENV - echo "CXX=clang++-13" >> $GITHUB_ENV + echo "CC=clang-18" >> $GITHUB_ENV + echo "CXX=clang++-18" >> $GITHUB_ENV echo "STYLE=true" >> $GITHUB_ENV @@ -79,30 +77,54 @@ jobs: # # Install Packages (Windows) # - - if: runner.os == 'Windows' + - if: runner.os == 'Windows' && matrix.compiler == 'msvc' + name: Install Qt for Windows (MSVC) uses: jurplel/install-qt-action@v4 with: version: 5.15.2 dir: 'C:\' arch: win64_msvc2019_64 cache: true - tools: 'tools_opensslv3_x64' - + - if: runner.os == 'Windows' && matrix.compiler == 'gcc' + name: Install Qt for Windows (MinGW) + uses: jurplel/install-qt-action@v4 + with: + version: 5.15.2 + dir: 'C:\' + arch: win64_mingw81 + cache: true + tools: 'tools_mingw1310' + - if: runner.os == 'Windows' + name: Install Packages for Windows + uses: crazy-max/ghaction-chocolatey@v3 + with: + args: install openssl --version=1.1.1.2100 # # Build # - - if: runner.os == 'Windows' && matrix.compiler == 'msvc' + - if: runner.os == 'Windows' name: Build MMapper for Windows - shell: cmd + shell: pwsh run: | - mkdir -p ${{ github.workspace }}/artifact - mkdir -p build + xcopy "C:\Program Files\OpenSSL" "C:\OpenSSL" /E /I /H /K /Y + mkdir ${{ github.workspace }}/artifact + mkdir build cd build cmake --version - cmake -DCMAKE_BUILD_TYPE=Debug -G "NMake Makefiles" -DCPACK_PACKAGE_DIRECTORY=${{ github.workspace }}/artifact -DUSE_UNITY_BUILD=false -DCMAKE_PREFIX_PATH="C:\Qt\5.12.2\msvc2019_64" -DOPENSSL_ROOT_DIR=C:/Qt/Tools/OpenSSLv3/Win_x64 -S .. || exit -1 - cmake --build . -j %NUMBER_OF_PROCESSORS% + # Compiler-specific logic + if ('${{ matrix.compiler }}' -eq 'msvc') { + $generator = "NMake Makefiles" + $qtPath = "C:\Qt\5.12.2\msvc2019_64" + } elseif ('${{ matrix.compiler }}' -eq 'gcc') { + $generator = "MinGW Makefiles" + $qtPath = "C:\Qt\5.12.2\mingw81_64" + echo "C:/Qt/Tools/mingw1310_64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + $env:PATH = "C:\Qt\Tools\mingw1310_64\bin;$env:PATH" + } + cmake -DCMAKE_BUILD_TYPE=Debug -G $generator -DCPACK_PACKAGE_DIRECTORY=${{ github.workspace }}/artifact -DUSE_UNITY_BUILD=false -DCMAKE_PREFIX_PATH=$qtPath -DOPENSSL_ROOT_DIR=C:/OpenSSL/ -S .. || exit -1 + cmake --build . -j $env:NUMBER_OF_PROCESSORS - if: runner.os == 'Linux' || runner.os == 'macOS' name: Build MMapper for Linux and Mac run: |