mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
-vcpkg is a submodule: useful to have versioning control of the dependencies; -use run-cmake action for building both linux and windows; -use vcpkg response file installing dependencies; same is to be used on CI and locally by devs;
This commit is contained in:
parent
dde5d09791
commit
d2e51bdb9b
53
.github/workflows/main.yml
vendored
53
.github/workflows/main.yml
vendored
@ -11,15 +11,13 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
triplet: x64-windows
|
triplet: x64-windows
|
||||||
vcpkgGitCommitId: '6282cab61d175974b1af06473db584b9b80dcd48'
|
|
||||||
vcpkgPackages: 'grpc'
|
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
triplet: x64-linux
|
triplet: x64-linux
|
||||||
vcpkgGitCommitId: '6282cab61d175974b1af06473db584b9b80dcd48'
|
|
||||||
vcpkgPackages: 'grpc'
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v2.5.0
|
uses: jurplel/install-qt-action@v2.5.0
|
||||||
with:
|
with:
|
||||||
@ -37,36 +35,39 @@ jobs:
|
|||||||
- name: Cache vcpkg artifacts
|
- name: Cache vcpkg artifacts
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
env:
|
env:
|
||||||
cache-name: cache-vcpkg-modules
|
vcpkgResponseFile: '${{ github.workspace }}/vcpkg_${{ matrix.triplet }}.txt'
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/vcpkg/
|
path: ${{ github.workspace }}/vcpkg/
|
||||||
key: ${{ env.cache-name }}-${{ runner.os }}
|
# Ensure the cache is invalidated any time vcpkg version changes, or a different set of packages is being used.
|
||||||
|
key: ${{ hashFiles( env.vcpkgResponseFile ) }}-${{ hashFiles('.git/modules/vcpkg/HEAD') }}-${{ runner.os }}
|
||||||
- name: Run vcpkg
|
- name: Run vcpkg
|
||||||
uses: lukka/run-vcpkg@v0.10
|
uses: lukka/run-vcpkg@v0
|
||||||
id: runvcpkg
|
id: runvcpkg
|
||||||
|
env:
|
||||||
|
vcpkgResponseFile: '${{ github.workspace }}/vcpkg_${{ matrix.triplet }}.txt'
|
||||||
with:
|
with:
|
||||||
vcpkgArguments: '${{ matrix.vcpkgPackages }}'
|
vcpkgArguments: '@${{ env.vcpkgResponseFile }}'
|
||||||
vcpkgTriplet: '${{ matrix.triplet }}'
|
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
|
||||||
vcpkgGitCommitId: '${{ matrix.vcpkgGitCommitId }}'
|
|
||||||
- name: Prints outputs of run-vcpkg task
|
- name: Prints outputs of run-vcpkg task
|
||||||
run: echo "'${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}' '${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_TRIPLET_OUT }}' "
|
run: echo "'${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}' '${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_TRIPLET_OUT }}' "
|
||||||
- name: Build ResInsight-x64 Windows
|
- name: Build ResInsight-x64
|
||||||
if: "contains( matrix.os, 'windows')"
|
uses: lukka/run-cmake@v0
|
||||||
|
with:
|
||||||
|
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||||
|
cmakeAppendedArgs: -DRESINSIGHT_ENABLE_GRPC=true -DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=python -DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=true -DRESINSIGHT_ENABLE_UNITY_BUILD=true
|
||||||
|
buildDirectory: ${{ github.workspace }}/cmakebuild
|
||||||
|
buildWithCMakeArgs: '--config Release --target package'
|
||||||
|
useVcpkgToolchainFile: true
|
||||||
|
- name: Remove packages/_CPack_Packages
|
||||||
|
shell: bash
|
||||||
run: |
|
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 -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -A x64
|
|
||||||
cmake --build . --config Release --target PACKAGE
|
|
||||||
rd packages/_CPack_Packages -Recurse
|
|
||||||
- name: Build ResInsight-x64 Linux
|
|
||||||
if: "contains( matrix.os, 'ubuntu')"
|
|
||||||
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 -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
|
|
||||||
cmake --build . --config Release
|
|
||||||
make package
|
|
||||||
rm -rf packages/_CPack_Packages
|
rm -rf packages/_CPack_Packages
|
||||||
|
- name: dir
|
||||||
|
run: find ${{ runner.workspace }}
|
||||||
|
if: "!contains( matrix.os, 'windows')"
|
||||||
|
- name: dir
|
||||||
|
run: gci -recurse ${{ runner.workspace }}
|
||||||
|
if: contains( matrix.os, 'windows')
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
if: "contains( matrix.os, 'windows')" # To be used when RESINSIGHT_GRPC_PYTHON_EXECUTABLE can be 'python' without extention in PATH
|
if: "contains( matrix.os, 'windows')" # To be used when RESINSIGHT_GRPC_PYTHON_EXECUTABLE can be 'python' without extention in PATH
|
||||||
env:
|
env:
|
||||||
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[submodule "vcpkg"]
|
||||||
|
path = vcpkg
|
||||||
|
url = https://github.com/microsoft/vcpkg
|
1
vcpkg
Submodule
1
vcpkg
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 6282cab61d175974b1af06473db584b9b80dcd48
|
3
vcpkg_x64-linux.txt
Normal file
3
vcpkg_x64-linux.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
grpc
|
||||||
|
--triplet
|
||||||
|
x64-linux
|
3
vcpkg_x64-windows.txt
Normal file
3
vcpkg_x64-windows.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
grpc
|
||||||
|
--triplet
|
||||||
|
x64-windows
|
Loading…
Reference in New Issue
Block a user