Skip to content

Merge pull request #93 from scharlton2/91-input-causes-crash #111

Merge pull request #93 from scharlton2/91-input-causes-crash

Merge pull request #93 from scharlton2/91-input-causes-crash #111

Workflow file for this run

name: build-qt5-vtk
on:
push:
paths-ignore:
- '*.md'
- 'rtd/**'
pull_request:
branches:
- 'main'
- 'develop'
workflow_dispatch:
env:
AQT_TARGET: desktop
AQT_VER: 5.15.2
VTK_VER: 9.1.0
# ${{ env.RUNNER_WORKSPACE }} doesn't seem to work on linux and macos
# but ${RUNNER_WORKSPACE} is set in the environment for all os
# therefore use ${{ runner.workspace }} instead of ${{ env.RUNNER_WORKSPACE }}
jobs:
init:
runs-on: ubuntu-latest
# Map step outputs to job outputs
outputs:
DATE_COMPILED: ${{ steps.vars.outputs.DATE_COMPILED }}
steps:
- name: Setup vars
id: vars
run: |
echo "DATE_COMPILED=$(date --rfc-3339=date) (compiled $(date "+%b %d %Y %H:%M:%S"))" >> $GITHUB_OUTPUT
build:
name: ${{ matrix.config.os }}
needs: [init]
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
os: macos-11,
aqt_host: mac,
aqt_arch: clang_64,
package_suffix: "dmg"
}
- {
os: macos-12,
aqt_host: mac,
aqt_arch: clang_64,
package_suffix: "dmg"
}
- {
os: ubuntu-20.04,
aqt_host: linux,
aqt_arch: gcc_64,
package_suffix: "gz"
}
- {
os: ubuntu-22.04,
aqt_host: linux,
aqt_arch: gcc_64,
package_suffix: "gz"
}
- {
os: windows-2019,
aqt_host: windows,
aqt_arch: win64_msvc2019_64,
package_suffix: "zip"
}
- {
os: windows-2022,
aqt_host: windows,
aqt_arch: win64_msvc2019_64,
package_suffix: "zip"
}
steps:
- uses: actions/checkout@v3
#
# Open 'PowerShell 7 for VS 2019 x64' in Windows Terminal
#
# see https://ddalcino.github.io/aqt-list-server/
# aqt install-qt mac desktop 5.15.2 clang_64 --dir ${HOME}/work/modelviewer-mf6/Qt
# aqt install-qt linux desktop 5.15.2 gcc_64 --dir ${HOME}/work/modelviewer-mf6/Qt
# aqt install-qt windows desktop 5.15.2 win64_msvc2019_64 --dir ${env:USERPROFILE}\work\modelviewer-mf6\Qt
#
- name: Install Qt (${{ env.AQT_VER }})
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.AQT_VER }}
host: ${{ matrix.config.aqt_host }}
target: ${{ env.AQT_TARGET }}
arch: ${{ matrix.config.aqt_arch }}
dir: ${{ runner.workspace }}
cache: true
cache-key-prefix: install-qt-action
tools: tools_ninja
- name: Add ninja path
shell: bash
run: |
echo "${IQTA_TOOLS}/Ninja" >> $GITHUB_PATH
- name: Download (qt5-vtk-${{ env.VTK_VER }}-${{ matrix.config.os }}.7z)
uses: robinraju/[email protected]
id: download
with:
repository: "MODFLOW-USGS/modelviewer-mf6-build-deps"
latest: true
# releaseId: "90254461" # 2023-01-26T02.03.20Z
fileName: "qt5-vtk-${{ env.VTK_VER }}-${{ matrix.config.os }}.7z"
- name: "Extract (Tag: ${{ steps.download.outputs.tag_name }})"
shell: bash
working-directory: ${{ runner.workspace }}
run: |
echo ${{ steps.download.outputs.tag_name }}
7z x "${{ github.workspace }}/qt5-vtk-${{ env.VTK_VER }}-${{ matrix.config.os }}.7z"
rm "${{ github.workspace }}/qt5-vtk-${{ env.VTK_VER }}-${{ matrix.config.os }}.7z"
- name: Set env vars
shell: bash
run: |
echo "MV_SHORT_SHA1=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "MV_DATE_COMPILED=${{ needs.init.outputs.DATE_COMPILED }}" >> $GITHUB_ENV
# the shell needs to be set to use ninja on windows
- name: Set up Visual Studio shell
if: runner.os == 'Windows'
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: "Configure modelviewer-mf6 for release"
if: ${{ github.ref_name == 'main' }}
env:
VTK_DIR: ${{ runner.workspace }}/qt5-vtk-${{ env.VTK_VER }}/lib/cmake
run: cmake -S . -B ./_ninja_multi -G "Ninja Multi-Config" -DMV_SHORT_SHA1="${{ env.MV_SHORT_SHA1 }}" -DMV_DATE_COMPILED="${{ env.MV_DATE_COMPILED }}"
- name: "Configure modelviewer-mf6 for prerelease"
if: ${{ github.ref_name != 'main' }}
env:
VTK_DIR: ${{ runner.workspace }}/qt5-vtk-${{ env.VTK_VER }}/lib/cmake
MV_VERSION_PRERELEASE: -prerelease.${{ github.run_number }}
run: cmake -S . -B ./_ninja_multi -G "Ninja Multi-Config" -DMV_SHORT_SHA1="${{ env.MV_SHORT_SHA1 }}" -DMV_DATE_COMPILED="${{ env.MV_DATE_COMPILED }}" -DMV_VERSION_PRERELEASE="${{ env.MV_VERSION_PRERELEASE }}"
- name: "Build modelviewer-mf6 debug with cmake"
run: cmake --build ./_ninja_multi --config Debug
- name: "Build modelviewer-mf6 release with cmake"
run: cmake --build ./_ninja_multi --config Release
- name: "Package modelviewer-mf6 release with cpack"
if: runner.os != 'Windows'
working-directory: ./_ninja_multi
run: cpack --verbose
- name: "Package modelviewer-mf6 release with cpack (Windows)"
if: runner.os == 'Windows'
working-directory: ./_ninja_multi
run: |
Write-Output 'Prepend $env:SystemRoot\System32 to the path so that fixup_bundle finds the right dbghelp.dll'
Write-Output 'see https://github.com/MODFLOW-USGS/modelviewer-mf6/issues/81'
$env:PATH="$env:SystemRoot\System32;$env:PATH"
cpack --verbose
- name: "Upload package"
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.os }}-artifact
path: ${{ github.workspace }}/_ninja_multi/*.${{ matrix.config.package_suffix }}