Skip to content

Commit

Permalink
Merge pull request #11316 from OPM/dev
Browse files Browse the repository at this point in the history
Release 2024.03
  • Loading branch information
magnesj authored Mar 25, 2024
2 parents 72e537a + e069e13 commit 4a0c2f2
Show file tree
Hide file tree
Showing 1,046 changed files with 31,237 additions and 45,985 deletions.
75 changes: 40 additions & 35 deletions .github/workflows/AppFwkUnitTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ jobs:
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@v3
uses: actions/checkout@v4

- name: Set apt mirror
# see https://github.com/actions/runner-images/issues/7048
Expand All @@ -22,61 +28,60 @@ jobs:
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') }}
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: 5.12.12
modules: qtscript
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
shell: cmake -P {0}
- name: Configure and build
run: |
execute_process(
COMMAND cmake
-S Fwk
-B cmakebuild
-G Ninja
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Bad exit status")
endif()
- name: Build
shell: cmake -P {0}
cmake -S Fwk/AppFwk ${{matrix.build_flags}} -B cmakebuild -G Ninja
cmake --build cmakebuild
- name: Install
run: |
set(ENV{NINJA_STATUS} "[%f/%t %o/sec] ")
execute_process(
COMMAND cmake --build cmakebuild
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Bad exit status")
endif()
cd cmakebuild
cmake --install . --prefix ${{github.workspace}}/cmakebuild/install
- name: Run Unit Tests
- name: Run Unit Tests Qt5
if: matrix.qtver == '5.12.12'
shell: bash
run: |
cmakebuild/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests/cafPdmCore_UnitTests
cmakebuild/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests/cafPdmXml_UnitTests
cmakebuild/AppFwk/cafProjectDataModel/cafProjectDataModel_UnitTests/cafProjectDataModel_UnitTests
cmakebuild/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests/cafPdmScripting_UnitTests
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 (does not work on Linux)
if: contains( matrix.os, 'windows')
- 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/AppFwk/cafUserInterface/cafUserInterface_UnitTests/cafUserInterface_UnitTests
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

59 changes: 38 additions & 21 deletions .github/workflows/ResInsightWithCache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,44 @@ jobs:
vcpkg-triplet: x64-windows,
build-python-module: true,
execute-unit-tests: true,
execute-pytests: true,
unity-build: true,
publish-to-pypi: false,
}
- {
name: "Ubuntu Latest gcc",
name: "Ubuntu 20.04 gcc",
os: ubuntu-20.04,
cc: "gcc",
cxx: "g++",
vcpkg-response-file: vcpkg_x64-linux.txt,
vcpkg-triplet: x64-linux,
build-python-module: true,
execute-unit-tests: true,
execute-pytests: true,
unity-build: false,
publish-to-pypi: true,
}
- {
name: "Ubuntu Latest clang",
os: ubuntu-20.04,
cc: "clang",
cxx: "clang++",
name: "Ubuntu 22.04 clang-16",
os: ubuntu-22.04,
cc: "clang-16",
cxx: "clang++-16",
vcpkg-response-file: vcpkg_x64-linux.txt,
vcpkg-triplet: x64-linux,
build-python-module: true,
execute-unit-tests: true,
execute-pytests: false,
unity-build: false,
publish-to-pypi: false,
}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Display Python version
Expand All @@ -84,7 +87,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r GrpcInterface/Python/requirements.txt
pip install -r GrpcInterface/Python/dev-requirements.txt
- name: Use CMake
uses: lukka/get-cmake@latest
Expand Down Expand Up @@ -116,7 +119,7 @@ jobs:
endif()
- name: Get current time
uses: josStorer/get-current-time@v2.0.2
uses: josStorer/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DD
Expand All @@ -126,7 +129,7 @@ jobs:

- name: Cache Buildcache
id: cache-buildcache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.BUILDCACHE_DIR }}
key: ${{ matrix.config.os }}-${{ matrix.config.cc }}-cache-v03-${{ steps.current-time.outputs.formattedTime }}
Expand All @@ -139,19 +142,32 @@ jobs:

- name: Set apt mirror
# see https://github.com/actions/runner-images/issues/7048
if: ${{contains( matrix.config.os, 'ubuntu') }}
if: contains( matrix.config.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.config.os, 'ubuntu') }}
if: contains( matrix.config.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 libhdf5-dev
- name: Install gcc-10
if: contains( matrix.config.cc, 'gcc')
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10
- name: Install clang-16
if: contains( matrix.config.cc, 'clang')
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
sudo apt-get upgrade
wget https://apt.llvm.org/llvm.sh
sudo chmod +x llvm.sh
sudo ./llvm.sh 16 all
- name: Install Qt
uses: jurplel/install-qt-action@v3
Expand All @@ -170,14 +186,14 @@ jobs:
appendedCacheKey: ${{ matrix.config.os }}-${{ matrix.config.cxx }}-cache-key-v2

- name: Cache dynamic version of OpenSSL (Linux)
if: ${{contains( matrix.config.os, 'ubuntu_disabled') }}
uses: actions/cache@v3
if: contains( matrix.config.os, 'ubuntu_disabled')
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/ThirdParty/vcpkg/installed/x64-linux-dynamic
key: ${{ matrix.config.os }}-vcpkg-x64-linux-dynamic_v05

- name: Install dynamic version of OpenSSL (Linux)
if: ${{contains( matrix.config.os, 'ubuntu') }}
if: contains( matrix.config.os, 'ubuntu')
run: |
$VCPKG_ROOT/vcpkg install --overlay-triplets=${{ github.workspace }}/ThirdParty/vcpkg-custom-triplets --triplet x64-linux-dynamic openssl
Expand All @@ -194,6 +210,7 @@ jobs:
-D CMAKE_BUILD_TYPE=$ENV{BUILD_TYPE}
-D CMAKE_INSTALL_PREFIX=cmakebuild/install
-D RESINSIGHT_BUNDLE_OPENSSL=true
-D RESINSIGHT_QT5_BUNDLE_LIBRARIES=true
-D RESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true
-D RESINSIGHT_TREAT_WARNINGS_AS_ERRORS=true
-D RESINSIGHT_ENABLE_PRECOMPILED_HEADERS=false
Expand Down Expand Up @@ -224,11 +241,12 @@ jobs:
- name: Stats for buildcache
run: ${{ github.workspace }}/buildcache/bin/buildcache -s

- name: Run Unit Tests
if: matrix.config.execute-unit-tests
shell: bash
run: |
cmakebuild/ApplicationExeCode/ResInsight --unittest
cmakebuild/ApplicationLibCode/UnitTests/ResInsight-tests
- name: (Python) Check types using mypy
if: matrix.config.build-python-module
Expand All @@ -239,7 +257,7 @@ jobs:
${{ steps.python-path.outputs.PYTHON_EXECUTABLE }} -m mypy *.py generated/generated_classes.py
- name: Run pytest
if: matrix.config.build-python-module
if: matrix.config.execute-pytests
env:
RESINSIGHT_EXECUTABLE: ${{ runner.workspace }}/ResInsight/cmakebuild/ApplicationExeCode/ResInsight
run: |
Expand All @@ -250,14 +268,13 @@ jobs:
- name: Upload python distribution folder
if: matrix.config.publish-to-pypi
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-distribution
path: GrpcInterface/Python/dist

- name: Upload Windows install artifact
if: ${{contains( matrix.config.os, 'windows') }}
uses: actions/upload-artifact@v3
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ResInsight-${{ matrix.config.name }}
path: ${{ runner.workspace }}/ResInsight/cmakebuild/install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
sudo apt-get update
sudo apt-get install --option="APT::Acquire::Retries=3" clang-format-15
clang-format-15 --version
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check format - ApplicationLibCode
run: |
cd ApplicationLibCode
Expand All @@ -36,7 +36,7 @@ jobs:
cd Fwk/AppFwk
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | grep -v gtest | xargs clang-format-15 -i
git diff
- uses: peter-evans/create-pull-request@v5
- uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Fixes by clang-format"
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand Down Expand Up @@ -69,11 +69,14 @@ jobs:
run: |
cd build
run-clang-tidy-15 -config-file ../ApplicationLibCode/.clang-tidy -fix files ApplicationLibCode
run-clang-tidy-15 -config-file ../GrpcInterface/.clang-tidy -fix files GrpcInterface
- name: Run clang-format after clang-tidy
run: |
cd ApplicationLibCode
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | xargs clang-format-15 -i
- uses: peter-evans/create-pull-request@v5
cd ../GrpcInterface
find -name '*.h' -o -name '*.cpp' -o -name '*.inl' | xargs clang-format-15 -i
- uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Fixes by clang-tidy"
Expand All @@ -82,3 +85,4 @@ jobs:
branch-suffix: random
add-paths: |
ApplicationLibCode/*
GrpcInterface/*
4 changes: 2 additions & 2 deletions .github/workflows/cmake-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Install cmakelang for cmake-format
run: |
python3 -m pip install --user cmakelang
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check format - ApplicationLibCode
run: |
~/.local/bin/cmake-format -c ${{ github.workspace }}/cmake/cmake-format.py -i CMakeLists.txt
Expand All @@ -28,7 +28,7 @@ jobs:
cd ..
git diff
- uses: peter-evans/create-pull-request@v5
- uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Fixes by cmake-format"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delete_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

org_name = "OPM"
repo_name = "ResInsight"
keep_artifacts = 20
keep_artifacts = 100

def get_all_artifacts(repo_name: str, headers: dict) -> []:
amount_items_per_page = 50
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/delete_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Remove old artifacts
Expand Down
Loading

0 comments on commit 4a0c2f2

Please sign in to comment.