From 5d257fcf7e108a85bb7ce04919c8d8e00da2a027 Mon Sep 17 00:00:00 2001 From: Dennis Hezel Date: Sun, 17 Oct 2021 11:26:02 +0200 Subject: [PATCH 1/5] chore: Use vcpkg in github workflow instead of conan --- .github/workflows/main.yml | 86 ++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 51 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b08c792..d16d331 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,70 +3,54 @@ name: CMake on: [push, pull_request] env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: RelWithDebInfo + BUILD_TYPE: Release + CMAKE_ARGS: '-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCPP_JWT_USE_VENDORED_NLOHMANN_JSON=off' + VCPKG_ARGUMENTS: 'nlohmann-json openssl gtest' + VCPKG_VERSION: '699c8779f1b0feb4ed3564716d1ed31f69663ea6' # Oct 16, 2021 jobs: build: - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.config.os }} strategy: + fail-fast: false matrix: - os: [windows-latest, ubuntu-latest] + config: + - { + name: 'Windows/2019/MSVC-19.30.30528.0', + os: windows-2019, + triplet: x64-windows, + parallel: 2, + } + - { + name: 'MacOSX/11/AppleClang-12.0.5.12050022', + os: macos-11, + triplet: x64-osx, + parallel: 3, + } + - { + name: 'Ubuntu/20.04/GCC-10.3.0', + os: ubuntu-20.04, + triplet: x64-linux, + parallel: 2, + } steps: - uses: actions/checkout@v1 - - uses: actions/setup-python@v1 + - name: Install vcpkg + uses: lukka/run-vcpkg@v7 with: - python-version: "3.x" - - - name: Install tools (Linux) - if: startsWith(runner.os, 'Linux') - run: | - sudo apt-get install python3-setuptools python3-wheel python3-pip - shell: bash - - - name: Install conan (Linux) - if: startsWith(runner.os, 'Linux') - run: | - sudo pip3 install conan --upgrade - shell: bash - - - name: Install conan (Windows) - if: startsWith(runner.os, 'Windows') - run: | - pip3 install conan --upgrade - shell: bash - - - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build - - - name: Install conan profile - working-directory: ${{runner.workspace}}/build - run: conan profile new default --detect - - - name: Use cpp 11 (Linux) - if: startsWith(runner.os, 'Linux') - run: | - conan profile update settings.compiler.libcxx=libstdc++11 default - shell: bash - - - name: Install conan dependencies - working-directory: ${{runner.workspace}}/build - run: conan install $GITHUB_WORKSPACE --build missing - shell: bash + vcpkgDirectory: ${{ runner.workspace }}/vcpkg + vcpkgArguments: ${{ env.VCPKG_ARGUMENTS }} + vcpkgGitCommitId: ${{ env.VCPKG_VERSION }} + vcpkgTriplet: ${{ matrix.config.triplet }} - name: Configure CMake - shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE + run: cmake -B ${{ github.workspace }}/build ${{ env.CMAKE_ARGS }} - name: Build - working-directory: ${{runner.workspace}}/build - shell: bash - run: cmake --build . --config $BUILD_TYPE + run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --parallel ${{ matrix.config.parallel }} - name: Test - working-directory: ${{runner.workspace}}/build - shell: bash - run: ctest --verbose + working-directory: ${{ github.workspace }}/build + run: ctest -C ${{ env.BUILD_TYPE }} -T test --parallel ${{ matrix.config.parallel }} --output-on-failure --timeout 200 From 3e02ab9c4fe55efcbbef91f716ecded86ac7e334 Mon Sep 17 00:00:00 2001 From: Dennis Hezel Date: Sun, 17 Oct 2021 11:26:44 +0200 Subject: [PATCH 2/5] trigger pipeline From df1f82b7081b9cb10e3a518c6b0fe45c6724055c Mon Sep 17 00:00:00 2001 From: Dennis Hezel Date: Sun, 17 Oct 2021 11:27:31 +0200 Subject: [PATCH 3/5] chore: Fix CMAKE_ARGS env var in github workflow --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d16d331..3e953a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,7 @@ on: [push, pull_request] env: BUILD_TYPE: Release - CMAKE_ARGS: '-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCPP_JWT_USE_VENDORED_NLOHMANN_JSON=off' + CMAKE_ARGS: '-DCMAKE_BUILD_TYPE=Release -DCPP_JWT_USE_VENDORED_NLOHMANN_JSON=off' VCPKG_ARGUMENTS: 'nlohmann-json openssl gtest' VCPKG_VERSION: '699c8779f1b0feb4ed3564716d1ed31f69663ea6' # Oct 16, 2021 From ace2ab8197f847672c8d5556c2a4d4384963c32d Mon Sep 17 00:00:00 2001 From: Dennis Hezel Date: Sun, 17 Oct 2021 12:11:41 +0200 Subject: [PATCH 4/5] chore: Add -DCMAKE_TOOLCHAIN_FILE to the cmake configure step of the github workflow --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3e953a2..fb90923 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,7 @@ jobs: vcpkgTriplet: ${{ matrix.config.triplet }} - name: Configure CMake - run: cmake -B ${{ github.workspace }}/build ${{ env.CMAKE_ARGS }} + run: cmake -B ${{ github.workspace }}/build -DCMAKE_TOOLCHAIN_FILE=${{ runner.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake ${{ env.CMAKE_ARGS }} - name: Build run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --parallel ${{ matrix.config.parallel }} From dd849d536ccb5c38022c7b033def502b993248f2 Mon Sep 17 00:00:00 2001 From: Dennis Hezel Date: Sun, 17 Oct 2021 12:24:42 +0200 Subject: [PATCH 5/5] style: Adjust name of GCC build job from GCC-10.3.0 to the correct GCC-9.3.0 in github workflow --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fb90923..902d107 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: parallel: 3, } - { - name: 'Ubuntu/20.04/GCC-10.3.0', + name: 'Ubuntu/20.04/GCC-9.3.0', os: ubuntu-20.04, triplet: x64-linux, parallel: 2,