Skip to content

Commit

Permalink
# This is a combination of 9 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

use run-vcpkg@v1 and run-cmake@v1

# This is the commit message OPM#2:

enable cmake tracing and dump of cmakecache.txt

# This is the commit message OPM#3:

print python version and environment

# This is the commit message OPM#4:

pwsh vs cmd environment?

# This is the commit message OPM#5:

cmd vs pwsh?

# This is the commit message OPM#6:

cmakecache after build

# This is the commit message OPM#7:

pwsh vs cmd

# This is the commit message OPM#8:

pwsh vs cmd

# This is the commit message OPM#9:

use run-cmake with fix for vxcproj's PATH management
  • Loading branch information
lukka committed Apr 1, 2020
1 parent 9841021 commit 25b0dbc
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 11 deletions.
65 changes: 54 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,70 @@ jobs:
# 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@v0
uses: lukka/run-vcpkg@v1
id: runvcpkg
with:
vcpkgArguments: '@${{ github.workspace }}/${{ matrix.vcpkg-response-file }}'
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
- 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: |
cmake -E environment
which python
if: always()
shell: pwsh
- run: |
cmake -E environment
where.exe python
shell: cmd
if: always()
- name: Build ResInsight-x64
uses: lukka/run-cmake@fix_vcxproj_path_handling
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeAppendedArgs: '-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'
buildDirectory: ${{ github.workspace }}/cmakebuild
buildWithCMakeArgs: '--config Release --target package'
useVcpkgToolchainFile: true
continue-on-error: true
- run: |
echo "CMakeCache.txt:"
cat ${{ github.workspace }}/cmakebuild/CMakeCache.txt
if: always()
- run: |
cmake -E environment
which python
if: always()
shell: pwsh
- run: |
cmake -E environment
where.exe python
shell: cmd
if: always()
- name: (Windows+cmd) Build ResInsight-x64
shell: cmd
run: |
mkdir cmakebuild
cd cmakebuild
mkdir cmakebuild2
cd cmakebuild2
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')"
if: always()
- run: |
echo "CMakeCache.txt after build with 'run' step:"
cat ${{ github.workspace }}/cmakebuild2/CMakeCache.txt
if: always()
- name: (Windows+pwsh) Build ResInsight-x64
shell: pwsh
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
mkdir cmakebuild3
cd cmakebuild3
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
if: always()
- run: |
echo "CMakeCache.txt after build with 'run' step:"
cat ${{ github.workspace }}/cmakebuild3/CMakeCache.txt
if: always()
- name: Remove packages/_CPack_Packages
shell: bash
run: |
Expand Down
38 changes: 38 additions & 0 deletions ApplicationCode/GrpcInterface/CMakeLists.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,41 @@ list ( APPEND GRPC_CPP_SOURCES ${SOURCE_GROUP_SOURCE_FILES})

source_group( "GrpcInterface" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.cmake )
source_group( "GrpcInterface\\GrpcProtos" FILES ${GRPC_PROTO_FILES_FULL_PATH} )

set(RESINSIGHT_GRPC_PYTHON_EXECUTABLE python)

add_custom_target(print_env_target
ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/fake
)

add_custom_target(print_python_version
ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/fake2
)

add_custom_target(print_env2_target
ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/fake3
)

add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fake2
COMMAND ${RESINSIGHT_GRPC_PYTHON_EXECUTABLE} ARGS --version
COMMENT "Python version"
VERBATIM
)

add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fake
COMMAND cmake ARGS -E environment
COMMENT "Current env with cmake"
VERBATIM
)

add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fake3
COMMAND set
COMMENT "Current environment with 'set'"
VERBATIM
)

0 comments on commit 25b0dbc

Please sign in to comment.