From f56aea4af12ecbac8a0660af50b117ba0f483928 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Tue, 1 Jun 2021 13:48:23 +0200 Subject: [PATCH] Use VCPKG in the Github Action --- .github/workflows/cmake.yml | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index e115b10..efe623d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -26,12 +26,9 @@ jobs: steps: - uses: actions/checkout@v2 + with: + submodules: recursive - - name: Get Conan - run: | - pip3 install wheel setuptools - pip3 install conan --upgrade - - name: Fix Path on Ubuntu if: matrix.configurations.os == 'ubuntu-20.04' || matrix.configurations.os == 'ubuntu-18.04' run: echo "/home/runner/.local/bin" >> $GITHUB_PATH @@ -40,20 +37,20 @@ jobs: if: matrix.configurations.os == 'ubuntu-20.04' || matrix.configurations.os == 'ubuntu-18.04' run: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" - - name: Create Build Environment - # Some projects don't allow in-source building, so create a separate build directory - # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + - name: Bootstrap VCPKG + if: matrix.configurations.os == 'ubuntu-20.04' || matrix.configurations.os == 'ubuntu-18.04' + run: $GITHUB_WORKSPACE/vcpkg/bootstrap-vcpkg.sh + + - name: Bootstrap VCPKG + if: matrix.configurations.os == 'windows-2019' + run: $GITHUB_WORKSPACE\\bootstrap-vcpkg.bat - name: Configure CMake + working-directory: $GITHUB_WORKSPACE # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. - # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} + run: cmake -B ${{runner.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} - name: Build working-directory: ${{runner.workspace}}/build @@ -64,6 +61,6 @@ jobs: - name: Test working-directory: ${{runner.workspace}}/build shell: bash - # Execute tests defined by the CMake configuration. + # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest -C ${{ matrix.cmake-build-type }}