mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-03 20:57:39 -06:00
96 lines
3.5 KiB
YAML
96 lines
3.5 KiB
YAML
name: ResInsight Build and Package
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- dev
|
|
pull_request:
|
|
jobs:
|
|
ResInsight-x64:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
include:
|
|
- os: windows-latest
|
|
vcpkg-response-file: vcpkg_x64-windows.txt
|
|
- os: ubuntu-latest
|
|
vcpkg-response-file: vcpkg_x64-linux.txt
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
- name: Cache Qt
|
|
id: cache-qt
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ../Qt
|
|
key: ${{ runner.os }}-QtCache
|
|
- name: Install Qt
|
|
uses: jurplel/install-qt-action@v2
|
|
with:
|
|
version: 5.9.9
|
|
modules: qtscript
|
|
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
|
- name: Install Python dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install grpcio-tools
|
|
pip install pytest
|
|
- name: Install Linux dependencies
|
|
if: "contains( matrix.os, 'ubuntu')"
|
|
run: sudo apt-get install libxkbcommon-x11-0 libgl1-mesa-dev mesa-common-dev libglfw3-dev libglu1-mesa-dev libhdf5-dev
|
|
- name: Cache vcpkg artifacts
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ${{ github.workspace }}/vcpkg/
|
|
# Ensure the cache is invalidated any time vcpkg version changes, or a different set of packages is being used.
|
|
key: ${{ hashFiles( format('{0}/{1}', github.workspace, matrix.vcpkg-response-file )) }}-${{ hashFiles('.git/modules/vcpkg/HEAD') }}-${{ runner.os }}
|
|
- name: Run vcpkg
|
|
uses: lukka/run-vcpkg@v1
|
|
id: runvcpkg
|
|
with:
|
|
vcpkgArguments: '@${{ github.workspace }}/${{ matrix.vcpkg-response-file }}'
|
|
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
|
|
- name: Build ResInsight-x64
|
|
uses: lukka/run-cmake@v1
|
|
with:
|
|
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
|
cmakeAppendedArgs: '-DGSL_ENABLE=true -DRESINSIGHT_ENABLE_GRPC=true -DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=python -DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=true -DRESINSIGHT_ENABLE_UNITY_BUILD=true -DRESINSIGHT_TREAT_WARNINGS_AS_ERRORS=true -DRESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true'
|
|
buildDirectory: ${{ github.workspace }}/cmakebuild
|
|
buildWithCMakeArgs: '--config Release --target package'
|
|
useVcpkgToolchainFile: true
|
|
continue-on-error: true
|
|
- name: Remove packages/_CPack_Packages
|
|
shell: bash
|
|
run: |
|
|
rm -rf cmakebuild/packages/_CPack_Packages
|
|
- name: Test with pytest
|
|
if: "contains( matrix.os, 'windows')"
|
|
env:
|
|
RESINSIGHT_EXECUTABLE: ${{ runner.workspace }}/ResInsight/cmakebuild/ApplicationCode/Release/ResInsight.exe
|
|
run: |
|
|
cd ApplicationCode/GrpcInterface/Python/rips
|
|
pytest --console
|
|
- name: (Windows) Run Unit Tests
|
|
if: contains( matrix.os, 'windows')
|
|
shell: bash
|
|
run: |
|
|
cmakebuild/ApplicationCode/Release/ResInsight --unittest
|
|
- name: (Linux) Run Unit Tests
|
|
if: "!contains( matrix.os, 'windows')"
|
|
shell: bash
|
|
run: |
|
|
cmakebuild/ApplicationCode/ResInsight --unittest
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: ResInsight
|
|
path: ${{ runner.workspace }}/ResInsight/cmakebuild/packages
|
|
|
|
|
|
|