Build OpenMS package #5
This file contains hidden or 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: Build OpenMS package | |
| on: | |
| workflow_dispatch: | |
| env: | |
| OPENMS_VERSION: 3.5.0 | |
| TOPP_TOOLS: "OpenNuXL" | |
| jobs: | |
| build-openms: | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: OpenMS/OpenMS | |
| ref: develop | |
| path: OpenMS | |
| - name: Install Qt (Windows) | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: '6.8.3' | |
| arch: 'win64_msvc2022_64' | |
| cache: 'false' | |
| archives: 'qtsvg qtimageformats qtbase' | |
| - name: Locate Qt runtime and CMake package | |
| shell: pwsh | |
| run: | | |
| $qtCore = Get-ChildItem -Path "$env:RUNNER_WORKSPACE", "$env:RUNNER_TEMP", "C:\Qt" ` | |
| -Filter Qt6Core.dll -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 | |
| if (-not $qtCore) { | |
| throw "Qt6Core.dll not found after install-qt-action" | |
| } | |
| $qtBin = $qtCore.Directory.FullName | |
| $qtRoot = Split-Path $qtBin -Parent | |
| $qtCMakeDir = Join-Path $qtRoot "lib\cmake\Qt6" | |
| if (-not (Test-Path (Join-Path $qtBin "Qt6Core.dll"))) { | |
| throw "Qt6Core.dll missing in $qtBin" | |
| } | |
| if (-not (Test-Path $qtCMakeDir)) { | |
| throw "Qt6 CMake package dir not found: $qtCMakeDir" | |
| } | |
| "QT_BIN_DIR=$qtBin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| "QT_ROOT_DIR=$qtRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| "Qt6_DIR=$qtCMakeDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| $qtBin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| Write-Host "Using Qt bin: $qtBin" | |
| Write-Host "Using Qt root: $qtRoot" | |
| Write-Host "Using Qt6_DIR: $qtCMakeDir" | |
| - name: Set up Visual Studio shell | |
| uses: egor-tensin/vs-shell@v2 | |
| with: | |
| arch: x64 | |
| - name: Setup build tools | |
| shell: bash | |
| run: | | |
| choco install ccache ninja -y --no-progress | |
| choco install cmake --version=3.31.1 -y --no-progress --force | |
| echo "C:/Program Files (x86)/GitHub CLI" >> $GITHUB_PATH | |
| - name: Extract branch/PR infos | |
| shell: bash | |
| run: | | |
| cd OpenMS | |
| RUN_NAME_LOCAL=$(echo ${GITHUB_REF#refs/heads/} | tr / -) | |
| echo "RUN_NAME=${RUN_NAME_LOCAL}" >> $GITHUB_ENV | |
| echo "BASE_REF=$(gh pr view --json baseRefName -q .baseRefName || echo ${RUN_NAME_LOCAL})" >> $GITHUB_ENV | |
| id: extract_branch | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Cache contrib | |
| id: cache-contrib-win | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/OpenMS/contrib | |
| key: ${{ runner.os }}-contrib3 | |
| - name: Load contrib build | |
| if: steps.cache-contrib-win.outputs.cache-hit != 'true' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: bash | |
| run: | | |
| cd OpenMS/contrib | |
| gh release download -R OpenMS/contrib --pattern 'contrib_build-Windows.tar.gz' | |
| 7z x -so contrib_build-Windows.tar.gz | 7z x -si -ttar | |
| rm contrib_build-Windows.tar.gz | |
| ls | |
| - name: Add contrib to PATH | |
| shell: bash | |
| run: | | |
| echo "${{ github.workspace }}/OpenMS/contrib/lib" >> $GITHUB_PATH | |
| - name: Setup ccache cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .ccache | |
| key: ${{ runner.os }}-ccache-${{ env.RUN_NAME }}-${{ github.run_number }} | |
| restore-keys: | | |
| ${{ runner.os }}-ccache-${{ env.RUN_NAME }} | |
| ${{ runner.os }}-ccache-${{ env.BASE_REF }} | |
| ${{ runner.os }}-ccache- | |
| - name: Add THIRDPARTY | |
| shell: bash | |
| run: | | |
| cd OpenMS | |
| git submodule update --init THIRDPARTY | |
| cd .. | |
| mkdir -p _thirdparty | |
| cp -R OpenMS/THIRDPARTY/Windows/x86_64/* _thirdparty/ | |
| cp -R OpenMS/THIRDPARTY/All/* _thirdparty/ | |
| for thirdpartytool in ${{ github.workspace }}/_thirdparty/* | |
| do | |
| echo $thirdpartytool >> $GITHUB_PATH | |
| done | |
| - name: Build Windows | |
| shell: bash | |
| run: | | |
| mkdir -p "$GITHUB_WORKSPACE/OpenMS/bld" | |
| bash OpenMS/tools/ci/capture-env.sh -v "$GITHUB_WORKSPACE/OpenMS/bld/CMakeCache.txt" | |
| ctest --output-on-failure -V -S "$GITHUB_WORKSPACE/OpenMS/tools/ci/cibuild.cmake" | |
| env: | |
| OPENMS_CONTRIB_LIBS: "${{ github.workspace }}/OpenMS/contrib" | |
| CI_PROVIDER: "GitHub-Actions" | |
| CMAKE_GENERATOR: "Ninja" | |
| SOURCE_DIRECTORY: "${{ github.workspace }}/OpenMS" | |
| BUILD_NAME: "${{ env.RUN_NAME }}-Win64-class-topp-${{ github.run_number }}" | |
| ENABLE_STYLE_TESTING: "OFF" | |
| ENABLE_TOPP_TESTING: "ON" | |
| ENABLE_CLASS_TESTING: "ON" | |
| WITH_GUI: "OFF" | |
| WITH_PARQUET: "OFF" | |
| ADDRESS_SANITIZER: "Off" | |
| BUILD_TYPE: "Release" | |
| OPENMP: "Off" | |
| USE_STATIC_BOOST: "On" | |
| BUILD_FLAGS: "-j2" | |
| CMAKE_CCACHE_EXE: "ccache" | |
| CCACHE_BASEDIR: ${{ github.workspace }} | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| CCACHE_COMPRESS: true | |
| CCACHE_COMPRESSLEVEL: 12 | |
| CCACHE_MAXSIZE: 400M | |
| CMAKE_PREFIX_PATH: "${{ env.QT_ROOT_DIR }}" | |
| Qt6_DIR: "${{ env.Qt6_DIR }}" | |
| PATH: "${{ env.QT_BIN_DIR }};${{ github.workspace }}\\OpenMS\\contrib\\lib;${{ env.PATH }}" | |
| - name: Verify runtime DLL visibility before packaging | |
| shell: pwsh | |
| run: | | |
| Write-Host "QT_BIN_DIR=$env:QT_BIN_DIR" | |
| Write-Host "QT_ROOT_DIR=$env:QT_ROOT_DIR" | |
| Write-Host "Qt6_DIR=$env:Qt6_DIR" | |
| if (-not (Test-Path (Join-Path $env:QT_BIN_DIR "Qt6Core.dll"))) { | |
| throw "Qt6Core.dll is not reachable in QT_BIN_DIR" | |
| } | |
| Get-ChildItem "$env:QT_BIN_DIR" | Where-Object { $_.Name -like "Qt6*.dll" } | Select-Object Name | |
| - name: Package | |
| shell: bash | |
| run: | | |
| ctest --output-on-failure -V -S "$GITHUB_WORKSPACE/OpenMS/tools/ci/cipackage.cmake" | |
| env: | |
| SOURCE_DIRECTORY: "${{ github.workspace }}/OpenMS" | |
| PACKAGE_TYPE: zip | |
| SEARCH_ENGINES_DIRECTORY: "${{ github.workspace }}/_thirdparty" | |
| CI_PROVIDER: "GitHub-Actions" | |
| CPACK_PACKAGE_FILE_NAME: "openms-package" | |
| BUILD_NAME: "${{ env.RUN_NAME }}-Win64-class-topp-${{ github.run_number }}" | |
| CMAKE_PREFIX_PATH: "${{ env.QT_ROOT_DIR }}" | |
| Qt6_DIR: "${{ env.Qt6_DIR }}" | |
| PATH: "${{ env.QT_BIN_DIR }};${{ github.workspace }}\\OpenMS\\contrib\\lib;${{ env.PATH }}" | |
| - name: Upload package as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: openms-package | |
| path: | | |
| ${{ github.workspace }}/OpenMS/bld/*.zip | |
| ${{ github.workspace }}/OpenMS/bld/_CPack_Packages/**/* |