ResInsight/.github/workflows/main.yml

91 lines
3.9 KiB
YAML
Raw Normal View History

2020-02-24 09:07:02 -06:00
name: ResInsight Build
2020-02-25 03:38:19 -06:00
on: [push, pull_request]
2020-02-24 09:07:02 -06:00
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
2020-02-24 09:07:02 -06:00
- os: ubuntu-latest
vcpkg-response-file: vcpkg_x64-linux.txt
2020-02-24 09:07:02 -06:00
steps:
2020-02-27 09:02:04 -06:00
- name: Checkout
uses: actions/checkout@v1
with:
submodules: true
2020-02-27 09:02:04 -06:00
- name: Install Qt
uses: jurplel/install-qt-action@v2.5.0
2020-02-27 09:02:04 -06:00
with:
version: 5.9.9
2020-02-27 09:02:04 -06:00
modules: qtscript
mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
2020-02-24 09:07:02 -06:00
- 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
- 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 }}
2020-02-24 09:07:02 -06:00
- name: Run vcpkg
uses: lukka/run-vcpkg@v0
2020-02-24 09:07:02 -06:00
id: runvcpkg
with:
vcpkgArguments: '@${{ github.workspace }}/${{ matrix.vcpkg-response-file }}'
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
2020-02-24 09:07:02 -06:00
- name: Prints outputs of run-vcpkg task
run: echo "'${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}' '${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_TRIPLET_OUT }}' "
- name: (Windows) Build ResInsight-x64
if: "contains( matrix.os, 'windows')"
run: |
mkdir cmakebuild
cd cmakebuild
cmake .. -DRESINSIGHT_ENABLE_GRPC=true -DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=python -DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=true -DRESINSIGHT_ENABLE_UNITY_BUILD=true -DRESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -A x64
cmake --build . --config Release --target PACKAGE
- name: (Linux) Build ResInsight-x64
if: "!contains( matrix.os, 'windows')"
run: |
mkdir cmakebuild
cd cmakebuild
cmake .. -DRESINSIGHT_ENABLE_GRPC=true -DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=python -DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=true -DRESINSIGHT_ENABLE_UNITY_BUILD=true -DRESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build . --config Release --target package
- name: Remove packages/_CPack_Packages
shell: bash
2020-02-24 09:07:02 -06:00
run: |
rm -rf cmakebuild/packages/_CPack_Packages
2020-02-24 09:07:02 -06:00
- name: Test with pytest
if: "contains( matrix.os, 'windows')"
2020-02-24 09:07:02 -06:00
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
2020-02-24 09:07:02 -06:00
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: ResInsight
path: ${{ runner.workspace }}/ResInsight/cmakebuild/packages