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

View file

@ -26,12 +26,9 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with:
submodules: recursive
- name: Get Conan
run: |
pip3 install wheel setuptools
pip3 install conan --upgrade
- name: Fix Path on Ubuntu - name: Fix Path on Ubuntu
if: matrix.configurations.os == 'ubuntu-20.04' || matrix.configurations.os == 'ubuntu-18.04' if: matrix.configurations.os == 'ubuntu-20.04' || matrix.configurations.os == 'ubuntu-18.04'
run: echo "/home/runner/.local/bin" >> $GITHUB_PATH 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' 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)" run: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
- name: Create Build Environment - name: Bootstrap VCPKG
# Some projects don't allow in-source building, so create a separate build directory if: matrix.configurations.os == 'ubuntu-20.04' || matrix.configurations.os == 'ubuntu-18.04'
# We'll use this as our working directory for all subsequent commands run: $GITHUB_WORKSPACE/vcpkg/bootstrap-vcpkg.sh
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Bootstrap VCPKG
if: matrix.configurations.os == 'windows-2019'
run: $GITHUB_WORKSPACE\\bootstrap-vcpkg.bat
- name: Configure CMake - name: Configure CMake
working-directory: $GITHUB_WORKSPACE
# Use a bash shell so we can use the same syntax for environment variable # Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system # access regardless of the host operating system
shell: bash shell: bash
working-directory: ${{runner.workspace}}/build run: cmake -B ${{runner.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }}
# 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 }}
- name: Build - name: Build
working-directory: ${{runner.workspace}}/build working-directory: ${{runner.workspace}}/build
@ -64,6 +61,6 @@ jobs:
- name: Test - name: Test
working-directory: ${{runner.workspace}}/build working-directory: ${{runner.workspace}}/build
shell: bash 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 # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{ matrix.cmake-build-type }} run: ctest -C ${{ matrix.cmake-build-type }}