Use VCPKG in the Github Action

This commit is contained in:
Corentin Jabot 2021-06-01 13:48:23 +02:00
parent aa89c2267a
commit f56aea4af1
1 changed files with 12 additions and 15 deletions

View File

@ -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 }}