Skip to content

Commit

Permalink
fix CI build (#358)
Browse files Browse the repository at this point in the history
* upgrade to Ubuntu 24.04
* enable MinGW GCC 13 builds
* switch to Chocolatey OpenSSL
  • Loading branch information
nschimme authored Dec 7, 2024
1 parent c01c3d0 commit 173e620
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
60 changes: 41 additions & 19 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,17 @@ 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'
- os: macos-latest
compiler: 'msvc'
- os: windows-2022
compiler: 'clang'
- os: windows-2022
compiler: 'gcc'
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -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
Expand All @@ -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: |
Expand Down

0 comments on commit 173e620

Please sign in to comment.