Skip to content

Remove auto generated text #278

Remove auto generated text

Remove auto generated text #278

Workflow file for this run

name: Test ResInsight
on:
schedule:
- cron: "00 14 * * 0,3"
push:
branches:
- main
tags: "*"
pull_request:
env:
ERT_SHOW_BACKTRACE: 1
RESINSIGHT_VERSION: "2024.09.1"
RIPS_VERSION: "2024.9.1.3"
INSTALL_DIR: resinsight_bin
jobs:
build_dependencies:
name: "build-deps_${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- uses: "actions/cache@v4"
id: cache-package
with:
key: ${{ matrix.os }}_resinsight_${{ env.RESINSIGHT_VERSION }}
path: ${{ github.workspace }}/resinsight_${{ env.RESINSIGHT_VERSION }}.tar.gz
- name: Free Disk Space (Ubuntu) # To avoid disk space issues on runners
if: steps.cache-package.outputs.cache-hit != 'true'
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
vswap-storage: true
- name: Install dependencies
if: steps.cache-package.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get -y install build-essential gcc-10 g++-10 curl zip unzip tar linux-libc-dev
sudo apt-get install libxkbcommon-x11-0 libgl1-mesa-dev mesa-common-dev libglfw3-dev libglu1-mesa-dev libhdf5-dev
- name: Install Qt
if: steps.cache-package.outputs.cache-hit != 'true'
uses: jurplel/install-qt-action@v4
with:
version: 5.12.12
dir: "${{ github.workspace }}/Qt/"
cache: true
modules: "qtnetworkauth"
- name: Switch cpp compiler
if: steps.cache-package.outputs.cache-hit != 'true'
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
sudo update-alternatives --auto g++
sudo update-alternatives --auto gcc
- name: Clone ResInsight
if: steps.cache-package.outputs.cache-hit != 'true'
run: |
git clone -b v${{ env.RESINSIGHT_VERSION }} https://github.com/OPM/ResInsight.git
- name: Build ResInsight dependencies
if: steps.cache-package.outputs.cache-hit != 'true'
run: |
cd ResInsight
git submodule update --init
ThirdParty/vcpkg/bootstrap-vcpkg.sh
- name: Build ResInsight
if: steps.cache-package.outputs.cache-hit != 'true'
run: |
# Installation of ResInsight may fail if this directory does not exist:
mkdir -p ResInsight/GrpcInterface/Python/rips/generated
mkdir ResInsight/build
cd ResInsight/build
cmake .. \
-DRESINSIGHT_ENABLE_GRPC=true \
-DVCPKG_TARGET_TRIPLET=x64-linux \
-DCMAKE_TOOLCHAIN_FILE=../ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DBUILD_PYTHON=OFF \
-DRESINSIGHT_GRPC_DOWNLOAD_PYTHON_MODULE=OFF \
-DRESINSIGHT_GRPC_BUNDLE_PYTHON_MODULE=OFF \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/${{ env.INSTALL_DIR }} \
-DRESINSIGHT_ENABLE_HDF5=OFF
make -j$( nproc ) install
- name: Package ResInsight
if: steps.cache-package.outputs.cache-hit != 'true'
run: |
tar zcf resinsight_${{ env.RESINSIGHT_VERSION }}.tar.gz ${{ env.INSTALL_DIR }}
- name: Archive ResInsight
if: steps.cache-package.outputs.cache-hit != 'true'
uses: actions/upload-artifact@v4
with:
name: resinsight_${{ env.RESINSIGHT_VERSION }}
path: ${{ github.workspace }}/resinsight_${{ env.RESINSIGHT_VERSION }}.tar.gz
tests:
needs: build_dependencies
if: ${{ always() && needs.build_dependencies.result != 'failed' }}
name: "tests_${{ matrix.os }}_py-${{ matrix.python-version }}_resinsight"
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- uses: "actions/setup-python@v5"
with:
python-version: "${{ matrix.python-version }}"
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
- uses: actions/cache/restore@v4
id: restore-cached-package
with:
key: ${{ matrix.os }}_resinsight_${{ env.RESINSIGHT_VERSION }}
path: ${{ github.workspace }}/resinsight_${{ env.RESINSIGHT_VERSION }}.tar.gz
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 5.12.12
dir: "${{ github.workspace }}/Qt/"
cache: true
modules: "qtnetworkauth"
- name: Install ResInsight
run: |
sudo apt-get update
sudo apt-get install libxkbcommon-x11-0 libgl1-mesa-dev mesa-common-dev libglfw3-dev libglu1-mesa-dev
# Unpack after checking out, otherwise the checkout action would delete it:
tar zxf resinsight_${{ env.RESINSIGHT_VERSION }}.tar.gz
- name: "Install the package"
run: |
pip install --upgrade pip
# Make sure we use a compatible rips:
pip install rips==${{ env.RIPS_VERSION }}
pip install .[test]
- name: Run tests using resinsight
run: |
RESINSIGHT_EXECUTABLE="${{ github.workspace }}/${{ env.INSTALL_DIR }}/ResInsight" pytest -sv --test-resinsight -m resinsight