Backup #15214
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: Application Framework Build with Unit Tests | |
on: [push, pull_request] | |
jobs: | |
ResInsight-x64: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
qtver: [5.12.12, 6.5.3] | |
include: | |
- qtver: 6.5.3 | |
build_flags: -DCEE_USE_QT6=ON -DCEE_USE_QT5=OFF | |
- qtver: 5.12.12 | |
build_flags: -DCEE_USE_QT6=OFF -DCEE_USE_QT5=ON | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set apt mirror | |
# see https://github.com/actions/runner-images/issues/7048 | |
if: ${{contains( matrix.os, 'ubuntu') }} | |
run: | | |
# make sure there is a `\t` between URL and `priority:*` attributes | |
printf 'http://azure.archive.ubuntu.com/ubuntu priority:1\n' | sudo tee /etc/apt/mirrors.txt | |
curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append /etc/apt/mirrors.txt | |
sudo sed -i 's/http:\/\/azure.archive.ubuntu.com\/ubuntu\//mirror+file:\/etc\/apt\/mirrors.txt/' /etc/apt/sources.list | |
- name: Install Linux dependencies | |
if: contains(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get update --option="APT::Acquire::Retries=3" | |
sudo apt-get install --option="APT::Acquire::Retries=3" libxkbcommon-x11-0 libgl1-mesa-dev mesa-common-dev libglfw3-dev libglu1-mesa-dev | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ matrix.qtver }} | |
dir: "${{ github.workspace }}/Qt/" | |
cache: true | |
cache-key-prefix: ${{ matrix.qtver }}-${{ matrix.os }} | |
- name: Get CMake and Ninja | |
uses: lukka/get-cmake@latest | |
- name: Use MSVC (Windows) | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Configure and build | |
run: | | |
cmake -S Fwk/AppFwk ${{matrix.build_flags}} -B cmakebuild -G Ninja | |
cmake --build cmakebuild | |
- name: Install | |
run: | | |
cd cmakebuild | |
cmake --install . --prefix ${{github.workspace}}/cmakebuild/install | |
- name: Run Unit Tests Qt5 | |
if: matrix.qtver == '5.12.12' | |
shell: bash | |
run: | | |
cmakebuild/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests/cafPdmCore_UnitTests | |
cmakebuild/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests/cafPdmXml_UnitTests | |
cmakebuild/cafProjectDataModel/cafProjectDataModel_UnitTests/cafProjectDataModel_UnitTests | |
cmakebuild/cafPdmScripting/cafPdmScripting_UnitTests/cafPdmScripting_UnitTests | |
- name: Run Unit Tests Windows Qt5 (does not work on Linux) | |
if: (contains( matrix.os, 'windows') && (matrix.qtver == '5.12.12')) | |
shell: bash | |
run: cmakebuild/cafUserInterface/cafUserInterface_UnitTests/cafUserInterface_UnitTests | |
- name: Run Unit Tests Qt6 | |
if: matrix.qtver == '6.5.3' | |
shell: bash | |
run: | | |
cmakebuild/install/bin/cafPdmCore_UnitTests | |
cmakebuild/install/bin/cafPdmXml_UnitTests | |
cmakebuild/install/bin/cafProjectDataModel_UnitTests | |
cmakebuild/install/bin/cafPdmScripting_UnitTests | |
- name: Run Unit Tests Windows Qt6 (does not work on Linux) | |
if: (contains( matrix.os, 'windows') && (matrix.qtver == '6.5.3')) | |
shell: bash | |
run: cmakebuild/install/bin/cafUserInterface_UnitTests | |