From 7ced8122a34e3a79f7affc0419ec1755526bb243 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Sun, 9 Oct 2022 15:07:16 +0200 Subject: [PATCH 01/18] Using test matrix for validating all combinations --- .github/workflows/ci.yml | 748 +++++++++++++++++---------------------- 1 file changed, 320 insertions(+), 428 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 545a14bec..ff9d56e5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,508 +1,412 @@ name: CI -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] +on: [push, workflow_dispatch] jobs: - ubuntu-22-04-static-gcc-ssl: + ubuntu-clang-openssl: + strategy: + matrix: + container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04"] + shared: [ON, OFF] + systemCurl: [ON, OFF] + buildType: [Debug, Release] runs-on: ubuntu-latest - container: ubuntu:22.04 + container: ${{ matrix.container }} steps: - name: Update package list run: apt update - - name: Install git - run: apt install -y git - - name: Checkout - uses: actions/checkout@v3 + - name: Install Dependencies + run: apt install -y git libssl-dev cmake build-essential clang libcurl4-openssl-dev + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 with: - submodules: true - - name: Install libssl-dev - run: apt install -y libssl-dev - - name: Install cmake - run: apt install -y cmake - - name: Install build-essential - run: apt install -y build-essential - - name: "[Release g++] Build & Test" + cmake-version: '3.22.x' + - name: Checkout + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: CPR_BUILD_TESTS: ON + CPR_BUILD_TESTS_SSL: ON + CPR_FORCE_OPENSSL_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} + USE_SYSTEM_CURL: ${{ matrix.systemCurl }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - cc: gcc - cxx: g++ - build-type: Release + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} + cc: clang + cxx: clang++ + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=OFF - - ubuntu-22-04-clang-static-ssl: + + ubuntu-gcc-openssl: + strategy: + matrix: + container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04"] + shared: [ON, OFF] + systemCurl: [ON, OFF] + buildType: [Debug, Release] runs-on: ubuntu-latest - container: ubuntu:22.04 + container: ${{ matrix.container }} steps: - name: Update package list run: apt update - - name: Install git - run: apt install -y git - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: Install libssl-dev - run: apt install -y libssl-dev - - name: Install cmake - run: apt install -y cmake - - name: Install build-essential - run: apt install -y build-essential - - name: Install clang - run: apt install -y clang - - name: "[Release g++] Build & Test" - env: - CPR_BUILD_TESTS: ON - uses: ashutoshvarma/action-cmake-build@master + - name: Install Dependencies + run: apt install -y git libssl-dev cmake build-essential libcurl4-openssl-dev + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - cc: clang - cxx: clang++ - build-type: Release - run-test: true - ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=OFF - - ubuntu-20-shared-gcc-ssl: - runs-on: ubuntu-20.04 - steps: + cmake-version: '3.22.x' - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: Update package list - run: sudo apt update - - name: Install libssl-dev - run: sudo apt install libssl-dev - - name: "[Release g++] Build & Test" + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: CPR_BUILD_TESTS: ON + CPR_BUILD_TESTS_SSL: ON + CPR_FORCE_OPENSSL_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} + USE_SYSTEM_CURL: ${{ matrix.systemCurl }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} cc: gcc cxx: g++ - build-type: Release + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=ON - ubuntu-20-static-gcc-mbedtls: - runs-on: ubuntu-20.04 + ubuntu-clang-mbedtls: + strategy: + matrix: + container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04"] + shared: [ON, OFF] + buildType: [Debug, Release] + runs-on: ubuntu-latest + container: ${{ matrix.container }} steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - name: Update package list - run: sudo apt update - - name: Install libmbedtls-dev - run: sudo apt install libmbedtls-dev - - name: "[Release g++] Build & Test" - env: - CPR_BUILD_TESTS: ON - CPR_BUILD_TESTS_SSL: OFF - CPR_FORCE_MBEDTLS_BACKEND: ON - uses: ashutoshvarma/action-cmake-build@master + run: apt update + - name: Install Dependencies + run: apt install -y git libssl-dev libmbedtls-dev cmake build-essential clang + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - cc: gcc - cxx: g++ - build-type: Release - run-test: true - ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=OFF - - ubuntu-20-shared-gcc-mbedtls: - runs-on: ubuntu-20.04 - steps: + cmake-version: '3.22.x' - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: Update package list - run: sudo apt update - - name: Install libmbedtls-dev - run: sudo apt install libmbedtls-dev - - name: "[Release g++] Build & Test" + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: CPR_BUILD_TESTS: ON - CPR_BUILD_TESTS_SSL: OFF + CPR_BUILD_TESTS_SSL: ON CPR_FORCE_MBEDTLS_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - cc: gcc - cxx: g++ - build-type: Release + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} + cc: clang + cxx: clang++ + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=ON - ubuntu-20-static-gcc-ssl: - runs-on: ubuntu-20.04 + ubuntu-gcc-mbedtls: + strategy: + matrix: + container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04"] + shared: [ON, OFF] + buildType: [Debug, Release] + runs-on: ubuntu-latest + container: ${{ matrix.container }} steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - name: Update package list - run: sudo apt update - - name: Install libssl-dev - run: sudo apt install libssl-dev - - name: "[Release g++] Build & Test" - env: - CPR_BUILD_TESTS: ON - uses: ashutoshvarma/action-cmake-build@master + run: apt update + - name: Install Dependencies + run: apt install -y git libssl-dev libmbedtls-dev cmake build-essential + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - cc: gcc - cxx: g++ - build-type: Release - run-test: true - ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=OFF - - ubuntu-18-gcc-shared-ssl: - runs-on: ubuntu-18.04 - steps: + cmake-version: '3.22.x' - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: Update package list - run: sudo apt update - - name: Install libssl-dev - run: sudo apt install libssl-dev - - name: "[Release g++] Build & Test" + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: CPR_BUILD_TESTS: ON + CPR_BUILD_TESTS_SSL: ON + CPR_FORCE_MBEDTLS_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} cc: gcc cxx: g++ - build-type: Release + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=ON - ubuntu-18-gcc-static-ssl: - runs-on: ubuntu-18.04 + fedora-clang-openssl: + strategy: + matrix: + container: ["fedora:latest"] + shared: [ON, OFF] + systemCurl: [ON, OFF] + buildType: [Debug, Release] + runs-on: ubuntu-latest + container: ${{ matrix.container }} steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - name: Update package list - run: sudo apt update - - name: Install libssl-dev - run: sudo apt install libssl-dev - - name: "[Release g++] Build & Test" - env: - CPR_BUILD_TESTS: ON - uses: ashutoshvarma/action-cmake-build@master - with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - cc: gcc - cxx: g++ - build-type: Release - run-test: true - ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=OFF - - ubuntu-18-gcc-shared-ssl-system-curl: - runs-on: ubuntu-18.04 - steps: + run: dnf update -y + - name: Install Dependencies + run: dnf install -y gcc clang git gcc gdb make openssl-devel libcurl-devel cmake - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: Update package list - run: sudo apt update - - name: Install libssl-dev - run: sudo apt install libcurl4-openssl-dev - - name: "[Release g++] Build & Test" + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: CPR_BUILD_TESTS: ON + CPR_BUILD_TESTS_SSL: ON + CPR_FORCE_OPENSSL_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} + USE_SYSTEM_CURL: ${{ matrix.systemCurl }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - configure-options: -DUSE_SYSTEM_CURL=ON -DBUILD_SHARED_LIBS=ON - cc: gcc - cxx: g++ - build-type: Release + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} + cc: clang + cxx: clang++ + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - ubuntu-18-gcc-static-ssl-system-curl: - runs-on: ubuntu-18.04 + fedora-gcc-openssl: + strategy: + matrix: + container: ["fedora:latest"] + shared: [ON, OFF] + systemCurl: [ON, OFF] + buildType: [Debug, Release] + runs-on: ubuntu-latest + container: ${{ matrix.container }} steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - name: Update package list - run: sudo apt update - - name: Install libssl-dev - run: sudo apt install libcurl4-openssl-dev - - name: "[Release g++] Build & Test" - env: - CPR_BUILD_TESTS: ON - uses: ashutoshvarma/action-cmake-build@master - with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - configure-options: -DUSE_SYSTEM_CURL=ON -DBUILD_SHARED_LIBS=OFF - cc: gcc - cxx: g++ - build-type: Release - run-test: true - ctest-options: -V - - ubuntu-18-gcc-ssl-address-leak-undefined-behavior-sanitizer: - runs-on: ubuntu-18.04 - steps: + run: dnf update -y + - name: Install Dependencies + run: dnf install -y gcc clang git gcc gdb make openssl-devel libcurl-devel cmake - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: Update package list - run: sudo apt update - - name: Install libssl-dev - run: sudo apt install libssl-dev - - name: Install sanitizer - run: sudo apt install libasan5 libubsan1 liblsan0 libtsan0 - - name: "[Release g++] Build & Test" + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: CPR_BUILD_TESTS: ON - CPR_DEBUG_SANITIZER_FLAG_ALL: ON + CPR_BUILD_TESTS_SSL: ON + CPR_FORCE_OPENSSL_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} + USE_SYSTEM_CURL: ${{ matrix.systemCurl }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} cc: gcc cxx: g++ - build-type: Debug + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - ubuntu-18-gcc-ssl-thread-sanitizer: - runs-on: ubuntu-18.04 - if: ${{ false }} # Disabled for now until all problems are resolved + fedora-clang-mbedtls: + strategy: + matrix: + container: ["fedora:latest"] + shared: [ON, OFF] + buildType: [Debug, Release] + runs-on: ubuntu-latest + container: ${{ matrix.container }} steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - name: Update package list - run: sudo apt update - - name: Install libssl-dev - run: sudo apt install libssl-dev - - name: Install sanitizer - run: sudo apt install libasan5 libubsan1 liblsan0 libtsan0 - - name: "[Release g++] Build & Test" - env: - CPR_BUILD_TESTS: ON - CPR_DEBUG_SANITIZER_FLAG_THREAD: ON - uses: ashutoshvarma/action-cmake-build@master - with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - cc: gcc - cxx: g++ - build-type: Debug - run-test: true - ctest-options: -V - - ubuntu-18-clang-shared-ssl: - runs-on: ubuntu-18.04 - steps: + run: dnf update -y + - name: Install Dependencies + run: dnf install -y gcc clang git gcc gdb make openssl-devel mbedtls-devel libcurl-devel cmake - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: Update package list - run: sudo apt update - - name: Install libssl-dev - run: sudo apt install libssl-dev - - name: "[Release g++] Build & Test" + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: CPR_BUILD_TESTS: ON + CPR_BUILD_TESTS_SSL: ON + CPR_FORCE_MBEDTLS_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} cc: clang cxx: clang++ - build-type: Release + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=ON - ubuntu-18-clang-static-ssl: - runs-on: ubuntu-18.04 + fedora-gcc-mbedtls: + strategy: + matrix: + container: ["fedora:latest"] + shared: [ON, OFF] + buildType: [Debug, Release] + runs-on: ubuntu-latest + container: ${{ matrix.container }} steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - name: Update package list - run: sudo apt update - - name: Install libssl-dev - run: sudo apt install libssl-dev - - name: "[Release g++] Build & Test" + run: dnf update -y + - name: Install Dependencies + run: dnf install -y gcc clang git gcc gdb make openssl-devel mbedtls-devel libcurl-devel cmake + - name: Checkout + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: CPR_BUILD_TESTS: ON + CPR_BUILD_TESTS_SSL: ON + CPR_FORCE_MBEDTLS_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - cc: clang - cxx: clang++ - build-type: Release + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} + cc: gcc + cxx: g++ + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=OFF - - windows-msvc-shared-ssl: - runs-on: windows-latest + + fedora-gcc-ssl-sanitizer: + strategy: + matrix: + buildType: [UdefSan, LeakSan, AddrSan] # ThreadSan is disabled for now until all problems are resolved: https://github.com/libcpr/cpr/issues/451 + runs-on: ubuntu-latest + container: "fedora:latest" # Use fedora for an up to date version of all sanitizers steps: + - name: Update package list + run: dnf update -y + - name: Install Dependencies + run: dnf install -y gcc clang git gcc gdb make openssl-devel libasan libubsan liblsan libtsan cmake - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: "[Release msvc] Build & Test" + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: - CMAKE_GENERATOR: "Visual Studio 17 2022" CPR_BUILD_TESTS: ON - CPR_BUILD_TESTS_SSL: OFF + CPR_BUILD_TESTS_SSL: ON uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - build-type: Release - target: ALL_BUILD + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} + cc: gcc + cxx: g++ + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=ON - windows-msvc-shared-winssl: - runs-on: windows-latest + windows22-msvc-ssl: + strategy: + matrix: + shared: [ON, OFF] + buildType: [Debug, Release] + runs-on: windows-2022 steps: - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: "[Release msvc] Build & Test" + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: CMAKE_GENERATOR: "Visual Studio 17 2022" CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: OFF - CPR_FORCE_WINSSL_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - build-type: Release - target: ALL_BUILD + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=ON - windows-msvc-static-ssl: - runs-on: windows-latest + windows19-msvc-ssl: + strategy: + matrix: + shared: [ON, OFF] + buildType: [Debug, Release] + runs-on: windows-2019 steps: - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: "[Release msvc] Build & Test" + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: - CMAKE_GENERATOR: "Visual Studio 17 2022" + CMAKE_GENERATOR: "Visual Studio 16 2019" CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: OFF + BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - build-type: Release - target: ALL_BUILD + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=OFF - - windows-msvc-shared-openssl: - runs-on: windows-latest + + windows22-msvc-openssl: + strategy: + matrix: + shared: [ON, OFF] + buildType: [Debug, Release] + runs-on: windows-2022 steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - name: Install OpenSSL run: choco install openssl -y - - name: "[Release msvc] Build & Test" + - name: Checkout + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: CMAKE_GENERATOR: "Visual Studio 17 2022" CPR_BUILD_TESTS: ON + CPR_BUILD_TESTS_SSL: ON CPR_FORCE_OPENSSL_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - build-type: Release - target: ALL_BUILD + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=ON - windows-msvc-static-openssl: - runs-on: windows-latest + windows19-msvc-openssl: + strategy: + matrix: + shared: [ON, OFF] + buildType: [Debug, Release] + runs-on: windows-2019 steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - name: Install OpenSSL run: choco install openssl -y - - name: "[Release msvc] Build & Test" + - name: Checkout + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: - CMAKE_GENERATOR: "Visual Studio 17 2022" + CMAKE_GENERATOR: "Visual Studio 16 2019" CPR_BUILD_TESTS: ON + CPR_BUILD_TESTS_SSL: ON CPR_FORCE_OPENSSL_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - build-type: Release - target: ALL_BUILD + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=OFF - macos-clang-shared-openssl: - runs-on: macos-latest + macos-clang-openssl: + strategy: + matrix: + os: [macos-12, macos-11] + shared: [ON, OFF] + buildType: [Debug, Release] + runs-on: ${{ matrix.os }} steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - name: Install OpenSSL run: | brew install openssl @@ -511,123 +415,111 @@ jobs: export LDFLAGS="-L/usr/local/opt/openssl@3/lib" export CPPFLAGS="-I/usr/local/opt/openssl@3/include" export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig" - - name: "[Release clang++] Build & Test" + - name: Checkout + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON + CPR_FORCE_OPENSSL_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@3" OPENSSL_LIBRARIES: "/usr/local/opt/openssl@3/lib" uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - build-type: Release + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} cc: clang cxx: clang++ + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=ON - macos-clang-static-openssl: - runs-on: macos-latest + macos-clang-ssl: + strategy: + matrix: + os: [macos-12, macos-11] + shared: [ON, OFF] + buildType: [Debug, Release] + runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: Install OpenSSL - run: | - brew install openssl - echo 'export PATH="/usr/local/opt/openssl@3/bin:$PATH"' >> /Users/runner/.bash_profile - source ~/.bash_profile - export LDFLAGS="-L/usr/local/opt/openssl@3/lib" - export CPPFLAGS="-I/usr/local/opt/openssl@3/include" - export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig" - - name: "[Release clang++] Build & Test" + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: OFF - OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@3" - OPENSSL_LIBRARIES: "/usr/local/opt/openssl@3/lib" + BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - build-type: Release + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} cc: clang cxx: clang++ + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=OFF - - macos-clang-static-autossl: - runs-on: macos-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: "[Release clang++] Build & Test" - env: - CPR_BUILD_TESTS: ON - CPR_BUILD_TESTS_SSL: OFF - uses: ashutoshvarma/action-cmake-build@master - with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - build-type: Release - cc: clang - cxx: clang++ - run-test: true - ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=OFF - macos-clang-static-darwinssl: - runs-on: macos-latest + macos-clang-darwinssl: + strategy: + matrix: + os: [macos-12, macos-11] + shared: [ON, OFF] + buildType: [Debug, Release] + runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: "[Release clang++] Build & Test" + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: OFF + CPR_FORCE_DARWINSSL_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - build-type: Release + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} cc: clang cxx: clang++ + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=OFF -DCPR_FORCE_DARWINSSL_BACKEND=ON - macos-clang-static-autossl-boost: - runs-on: macos-latest + macos-clang-openssl-boost: + strategy: + matrix: + os: [macos-12, macos-11] + shared: [ON, OFF] + buildType: [Debug, Release] + runs-on: ${{ matrix.os }} steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - name: Install Boost + - name: Install OpenSSL run: | - brew install boost - - name: "[Release clang++] Build & Test" + brew install openssl + echo 'export PATH="/usr/local/opt/openssl@3/bin:$PATH"' >> /Users/runner/.bash_profile + source ~/.bash_profile + export LDFLAGS="-L/usr/local/opt/openssl@3/lib" + export CPPFLAGS="-I/usr/local/opt/openssl@3/include" + export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig" + - name: Checkout + uses: actions/checkout@v3.1.0 + - name: "Build & Test" env: + CMAKE_GENERATOR: "Visual Studio 16 2019" CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: OFF CPR_USE_BOOST_FILESYSTEM: ON - CMAKE_OSX_DEPLOYMENT_TARGET: 10.13 + CPR_FORCE_OPENSSL_BACKEND: ON + BUILD_SHARED_LIBS: ${{ matrix.shared }} + OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@3" + OPENSSL_LIBRARIES: "/usr/local/opt/openssl@3/lib" uses: ashutoshvarma/action-cmake-build@master with: - build-dir: ${{github.workspace}}/build - source-dir: ${{github.workspace}} - build-type: Release + build-dir: ${{ github.workspace }}/build + source-dir: ${{ github.workspace }} cc: clang cxx: clang++ + build-type: ${{ matrix.buildType }} run-test: true ctest-options: -V - configure-options: -DBUILD_SHARED_LIBS=OFF - From d3044e73629a8b7ed721d59cd0153bca97bfbaa4 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Mon, 24 Oct 2022 08:49:27 +0200 Subject: [PATCH 02/18] OpenSSL on macOS as env --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff9d56e5d..3bf9935cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -499,9 +499,6 @@ jobs: brew install openssl echo 'export PATH="/usr/local/opt/openssl@3/bin:$PATH"' >> /Users/runner/.bash_profile source ~/.bash_profile - export LDFLAGS="-L/usr/local/opt/openssl@3/lib" - export CPPFLAGS="-I/usr/local/opt/openssl@3/include" - export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig" - name: Checkout uses: actions/checkout@v3.1.0 - name: "Build & Test" @@ -514,6 +511,9 @@ jobs: BUILD_SHARED_LIBS: ${{ matrix.shared }} OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@3" OPENSSL_LIBRARIES: "/usr/local/opt/openssl@3/lib" + LDFLAGS: "-L/usr/local/opt/openssl@3/lib" + CPPFLAGS: "-I/usr/local/opt/openssl@3/include" + PKG_CONFIG_PATH: "/usr/local/opt/openssl@3/lib/pkgconfig" uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build From abe1e7771826feec17fb98f38809d8a0a6b59a39 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Sun, 14 May 2023 10:37:59 +0200 Subject: [PATCH 03/18] Ignoring clang-tidy avoid-do-while cppcoreguidelines-avoid-do-while --- .clang-tidy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index d18b254d5..7d9297732 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -33,7 +33,8 @@ Checks: '*, -bugprone-easily-swappable-parameters, -modernize-return-braced-init-list, -cppcoreguidelines-avoid-magic-numbers, --readability-magic-numbers +-readability-magic-numbers, +-cppcoreguidelines-avoid-do-while ' WarningsAsErrors: '*' HeaderFilterRegex: 'src/*.hpp' From 28c4f0c4668e78b77e8134e92481e22d23eb9ddf Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Sun, 14 May 2023 10:42:46 +0200 Subject: [PATCH 04/18] Triggering for PRs --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bf9935cb..cbe6c0949 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,5 @@ name: CI -on: [push, workflow_dispatch] +on: [push, workflow_dispatch, pull_request] jobs: ubuntu-clang-openssl: From c4a682e9176a3b49429417b6497ed41694821c53 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Sun, 14 May 2023 10:50:26 +0200 Subject: [PATCH 05/18] Added ubuntu 23.04 --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbe6c0949..d55d4779d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ jobs: ubuntu-clang-openssl: strategy: matrix: - container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04"] + container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"] shared: [ON, OFF] systemCurl: [ON, OFF] buildType: [Debug, Release] @@ -42,7 +42,7 @@ jobs: ubuntu-gcc-openssl: strategy: matrix: - container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04"] + container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"] shared: [ON, OFF] systemCurl: [ON, OFF] buildType: [Debug, Release] @@ -79,7 +79,7 @@ jobs: ubuntu-clang-mbedtls: strategy: matrix: - container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04"] + container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"] shared: [ON, OFF] buildType: [Debug, Release] runs-on: ubuntu-latest @@ -114,7 +114,7 @@ jobs: ubuntu-gcc-mbedtls: strategy: matrix: - container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04"] + container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"] shared: [ON, OFF] buildType: [Debug, Release] runs-on: ubuntu-latest From 46ee5c0f6751a8ab0e547d7576699fe16c5b5c48 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Sun, 14 May 2023 10:56:42 +0200 Subject: [PATCH 06/18] Removed BUILD_SHARED_LIBS from CI combinations --- .github/workflows/ci.yml | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d55d4779d..cca0105cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,6 @@ jobs: strategy: matrix: container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"] - shared: [ON, OFF] systemCurl: [ON, OFF] buildType: [Debug, Release] runs-on: ubuntu-latest @@ -27,7 +26,6 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON CPR_FORCE_OPENSSL_BACKEND: ON - BUILD_SHARED_LIBS: ${{ matrix.shared }} USE_SYSTEM_CURL: ${{ matrix.systemCurl }} uses: ashutoshvarma/action-cmake-build@master with: @@ -43,7 +41,6 @@ jobs: strategy: matrix: container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"] - shared: [ON, OFF] systemCurl: [ON, OFF] buildType: [Debug, Release] runs-on: ubuntu-latest @@ -64,7 +61,6 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON CPR_FORCE_OPENSSL_BACKEND: ON - BUILD_SHARED_LIBS: ${{ matrix.shared }} USE_SYSTEM_CURL: ${{ matrix.systemCurl }} uses: ashutoshvarma/action-cmake-build@master with: @@ -80,7 +76,6 @@ jobs: strategy: matrix: container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"] - shared: [ON, OFF] buildType: [Debug, Release] runs-on: ubuntu-latest container: ${{ matrix.container }} @@ -100,7 +95,6 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON CPR_FORCE_MBEDTLS_BACKEND: ON - BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build @@ -115,7 +109,6 @@ jobs: strategy: matrix: container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"] - shared: [ON, OFF] buildType: [Debug, Release] runs-on: ubuntu-latest container: ${{ matrix.container }} @@ -135,7 +128,6 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON CPR_FORCE_MBEDTLS_BACKEND: ON - BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build @@ -150,7 +142,6 @@ jobs: strategy: matrix: container: ["fedora:latest"] - shared: [ON, OFF] systemCurl: [ON, OFF] buildType: [Debug, Release] runs-on: ubuntu-latest @@ -167,7 +158,6 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON CPR_FORCE_OPENSSL_BACKEND: ON - BUILD_SHARED_LIBS: ${{ matrix.shared }} USE_SYSTEM_CURL: ${{ matrix.systemCurl }} uses: ashutoshvarma/action-cmake-build@master with: @@ -183,7 +173,6 @@ jobs: strategy: matrix: container: ["fedora:latest"] - shared: [ON, OFF] systemCurl: [ON, OFF] buildType: [Debug, Release] runs-on: ubuntu-latest @@ -200,7 +189,6 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON CPR_FORCE_OPENSSL_BACKEND: ON - BUILD_SHARED_LIBS: ${{ matrix.shared }} USE_SYSTEM_CURL: ${{ matrix.systemCurl }} uses: ashutoshvarma/action-cmake-build@master with: @@ -216,7 +204,6 @@ jobs: strategy: matrix: container: ["fedora:latest"] - shared: [ON, OFF] buildType: [Debug, Release] runs-on: ubuntu-latest container: ${{ matrix.container }} @@ -232,7 +219,6 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON CPR_FORCE_MBEDTLS_BACKEND: ON - BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build @@ -247,7 +233,6 @@ jobs: strategy: matrix: container: ["fedora:latest"] - shared: [ON, OFF] buildType: [Debug, Release] runs-on: ubuntu-latest container: ${{ matrix.container }} @@ -263,7 +248,6 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON CPR_FORCE_MBEDTLS_BACKEND: ON - BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build @@ -304,7 +288,6 @@ jobs: windows22-msvc-ssl: strategy: matrix: - shared: [ON, OFF] buildType: [Debug, Release] runs-on: windows-2022 steps: @@ -315,7 +298,6 @@ jobs: CMAKE_GENERATOR: "Visual Studio 17 2022" CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: OFF - BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build @@ -327,7 +309,6 @@ jobs: windows19-msvc-ssl: strategy: matrix: - shared: [ON, OFF] buildType: [Debug, Release] runs-on: windows-2019 steps: @@ -338,7 +319,6 @@ jobs: CMAKE_GENERATOR: "Visual Studio 16 2019" CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: OFF - BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build @@ -350,7 +330,6 @@ jobs: windows22-msvc-openssl: strategy: matrix: - shared: [ON, OFF] buildType: [Debug, Release] runs-on: windows-2022 steps: @@ -364,7 +343,6 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON CPR_FORCE_OPENSSL_BACKEND: ON - BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build @@ -376,7 +354,6 @@ jobs: windows19-msvc-openssl: strategy: matrix: - shared: [ON, OFF] buildType: [Debug, Release] runs-on: windows-2019 steps: @@ -390,7 +367,6 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON CPR_FORCE_OPENSSL_BACKEND: ON - BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build @@ -403,7 +379,6 @@ jobs: strategy: matrix: os: [macos-12, macos-11] - shared: [ON, OFF] buildType: [Debug, Release] runs-on: ${{ matrix.os }} steps: @@ -422,7 +397,6 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON CPR_FORCE_OPENSSL_BACKEND: ON - BUILD_SHARED_LIBS: ${{ matrix.shared }} OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@3" OPENSSL_LIBRARIES: "/usr/local/opt/openssl@3/lib" uses: ashutoshvarma/action-cmake-build@master @@ -439,7 +413,6 @@ jobs: strategy: matrix: os: [macos-12, macos-11] - shared: [ON, OFF] buildType: [Debug, Release] runs-on: ${{ matrix.os }} steps: @@ -449,7 +422,6 @@ jobs: env: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: OFF - BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build @@ -464,7 +436,6 @@ jobs: strategy: matrix: os: [macos-12, macos-11] - shared: [ON, OFF] buildType: [Debug, Release] runs-on: ${{ matrix.os }} steps: @@ -475,7 +446,6 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: OFF CPR_FORCE_DARWINSSL_BACKEND: ON - BUILD_SHARED_LIBS: ${{ matrix.shared }} uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build @@ -490,7 +460,6 @@ jobs: strategy: matrix: os: [macos-12, macos-11] - shared: [ON, OFF] buildType: [Debug, Release] runs-on: ${{ matrix.os }} steps: @@ -508,7 +477,6 @@ jobs: CPR_BUILD_TESTS_SSL: OFF CPR_USE_BOOST_FILESYSTEM: ON CPR_FORCE_OPENSSL_BACKEND: ON - BUILD_SHARED_LIBS: ${{ matrix.shared }} OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@3" OPENSSL_LIBRARIES: "/usr/local/opt/openssl@3/lib" LDFLAGS: "-L/usr/local/opt/openssl@3/lib" From 084d5c721b6ae479be93c0ed333bb0c43e50eb60 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Sun, 21 May 2023 13:02:05 +0200 Subject: [PATCH 07/18] Including openssl/applink.c --- cpr/ssl_ctx.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpr/ssl_ctx.cpp b/cpr/ssl_ctx.cpp index c0753d32a..23a4b9c84 100644 --- a/cpr/ssl_ctx.cpp +++ b/cpr/ssl_ctx.cpp @@ -9,6 +9,11 @@ #include #include +// Ensure we include 'applink.c' at least once on Window to fix "OPENSSL_Uplink(00007FFCE387ED50,08): no OPENSSL_Applink". +#ifdef _WIN32 +#include +#endif // _WIN32 + namespace cpr { /** From 146a81fbd729534ba0f4b6342a4ba09580ebd362 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Sun, 21 May 2023 13:06:56 +0200 Subject: [PATCH 08/18] Installing boost inside the CI --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cca0105cd..d2fdae1bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -463,6 +463,8 @@ jobs: buildType: [Debug, Release] runs-on: ${{ matrix.os }} steps: + - name: Install Boost + run: brew install boost - name: Install OpenSSL run: | brew install openssl From b91508d100bc36666d3e298fbd965b0b5256e4b8 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Sun, 21 May 2023 13:22:40 +0200 Subject: [PATCH 09/18] Revert "Including openssl/applink.c" This reverts commit ecdc77d4bf53c60f30124413c24335040ee34d80 since it did not fix anything. --- cpr/ssl_ctx.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cpr/ssl_ctx.cpp b/cpr/ssl_ctx.cpp index 23a4b9c84..c0753d32a 100644 --- a/cpr/ssl_ctx.cpp +++ b/cpr/ssl_ctx.cpp @@ -9,11 +9,6 @@ #include #include -// Ensure we include 'applink.c' at least once on Window to fix "OPENSSL_Uplink(00007FFCE387ED50,08): no OPENSSL_Applink". -#ifdef _WIN32 -#include -#endif // _WIN32 - namespace cpr { /** From 84f16c7f369f6d7819818776ea438f0ef87aecb4 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Sat, 24 Jun 2023 15:10:26 +0200 Subject: [PATCH 10/18] Further reduced the number of CI combinations --- .github/workflows/ci.yml | 189 ++++----------------------------------- 1 file changed, 15 insertions(+), 174 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2fdae1bc..6cbdf6d38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,46 +72,8 @@ jobs: run-test: true ctest-options: -V - ubuntu-clang-mbedtls: - strategy: - matrix: - container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"] - buildType: [Debug, Release] - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: Update package list - run: apt update - - name: Install Dependencies - run: apt install -y git libssl-dev libmbedtls-dev cmake build-essential clang - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 - with: - cmake-version: '3.22.x' - - name: Checkout - uses: actions/checkout@v3.1.0 - - name: "Build & Test" - env: - CPR_BUILD_TESTS: ON - CPR_BUILD_TESTS_SSL: ON - CPR_FORCE_MBEDTLS_BACKEND: ON - uses: ashutoshvarma/action-cmake-build@master - with: - build-dir: ${{ github.workspace }}/build - source-dir: ${{ github.workspace }} - cc: clang - cxx: clang++ - build-type: ${{ matrix.buildType }} - run-test: true - ctest-options: -V - ubuntu-gcc-mbedtls: - strategy: - matrix: - container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"] - buildType: [Debug, Release] runs-on: ubuntu-latest - container: ${{ matrix.container }} steps: - name: Update package list run: apt update @@ -134,7 +96,7 @@ jobs: source-dir: ${{ github.workspace }} cc: gcc cxx: g++ - build-type: ${{ matrix.buildType }} + build-type: Release run-test: true ctest-options: -V @@ -142,8 +104,6 @@ jobs: strategy: matrix: container: ["fedora:latest"] - systemCurl: [ON, OFF] - buildType: [Debug, Release] runs-on: ubuntu-latest container: ${{ matrix.container }} steps: @@ -158,14 +118,14 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON CPR_FORCE_OPENSSL_BACKEND: ON - USE_SYSTEM_CURL: ${{ matrix.systemCurl }} + USE_SYSTEM_CURL: OFF uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build source-dir: ${{ github.workspace }} cc: clang cxx: clang++ - build-type: ${{ matrix.buildType }} + build-type: Release run-test: true ctest-options: -V @@ -200,64 +160,6 @@ jobs: run-test: true ctest-options: -V - fedora-clang-mbedtls: - strategy: - matrix: - container: ["fedora:latest"] - buildType: [Debug, Release] - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: Update package list - run: dnf update -y - - name: Install Dependencies - run: dnf install -y gcc clang git gcc gdb make openssl-devel mbedtls-devel libcurl-devel cmake - - name: Checkout - uses: actions/checkout@v3.1.0 - - name: "Build & Test" - env: - CPR_BUILD_TESTS: ON - CPR_BUILD_TESTS_SSL: ON - CPR_FORCE_MBEDTLS_BACKEND: ON - uses: ashutoshvarma/action-cmake-build@master - with: - build-dir: ${{ github.workspace }}/build - source-dir: ${{ github.workspace }} - cc: clang - cxx: clang++ - build-type: ${{ matrix.buildType }} - run-test: true - ctest-options: -V - - fedora-gcc-mbedtls: - strategy: - matrix: - container: ["fedora:latest"] - buildType: [Debug, Release] - runs-on: ubuntu-latest - container: ${{ matrix.container }} - steps: - - name: Update package list - run: dnf update -y - - name: Install Dependencies - run: dnf install -y gcc clang git gcc gdb make openssl-devel mbedtls-devel libcurl-devel cmake - - name: Checkout - uses: actions/checkout@v3.1.0 - - name: "Build & Test" - env: - CPR_BUILD_TESTS: ON - CPR_BUILD_TESTS_SSL: ON - CPR_FORCE_MBEDTLS_BACKEND: ON - uses: ashutoshvarma/action-cmake-build@master - with: - build-dir: ${{ github.workspace }}/build - source-dir: ${{ github.workspace }} - cc: gcc - cxx: g++ - build-type: ${{ matrix.buildType }} - run-test: true - ctest-options: -V - fedora-gcc-ssl-sanitizer: strategy: matrix: @@ -285,11 +187,11 @@ jobs: run-test: true ctest-options: -V - windows22-msvc-ssl: + windows-msvc-ssl: strategy: matrix: buildType: [Debug, Release] - runs-on: windows-2022 + runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v3.1.0 @@ -306,32 +208,8 @@ jobs: run-test: true ctest-options: -V - windows19-msvc-ssl: - strategy: - matrix: - buildType: [Debug, Release] - runs-on: windows-2019 - steps: - - name: Checkout - uses: actions/checkout@v3.1.0 - - name: "Build & Test" - env: - CMAKE_GENERATOR: "Visual Studio 16 2019" - CPR_BUILD_TESTS: ON - CPR_BUILD_TESTS_SSL: OFF - uses: ashutoshvarma/action-cmake-build@master - with: - build-dir: ${{ github.workspace }}/build - source-dir: ${{ github.workspace }} - build-type: ${{ matrix.buildType }} - run-test: true - ctest-options: -V - - windows22-msvc-openssl: - strategy: - matrix: - buildType: [Debug, Release] - runs-on: windows-2022 + windows-msvc-openssl: + runs-on: windows-latest steps: - name: Install OpenSSL run: choco install openssl -y @@ -347,40 +225,12 @@ jobs: with: build-dir: ${{ github.workspace }}/build source-dir: ${{ github.workspace }} - build-type: ${{ matrix.buildType }} - run-test: true - ctest-options: -V - - windows19-msvc-openssl: - strategy: - matrix: - buildType: [Debug, Release] - runs-on: windows-2019 - steps: - - name: Install OpenSSL - run: choco install openssl -y - - name: Checkout - uses: actions/checkout@v3.1.0 - - name: "Build & Test" - env: - CMAKE_GENERATOR: "Visual Studio 16 2019" - CPR_BUILD_TESTS: ON - CPR_BUILD_TESTS_SSL: ON - CPR_FORCE_OPENSSL_BACKEND: ON - uses: ashutoshvarma/action-cmake-build@master - with: - build-dir: ${{ github.workspace }}/build - source-dir: ${{ github.workspace }} - build-type: ${{ matrix.buildType }} + build-type: Release run-test: true ctest-options: -V macos-clang-openssl: - strategy: - matrix: - os: [macos-12, macos-11] - buildType: [Debug, Release] - runs-on: ${{ matrix.os }} + runs-on: macos-latest steps: - name: Install OpenSSL run: | @@ -405,16 +255,15 @@ jobs: source-dir: ${{ github.workspace }} cc: clang cxx: clang++ - build-type: ${{ matrix.buildType }} + build-type: Release run-test: true ctest-options: -V macos-clang-ssl: strategy: matrix: - os: [macos-12, macos-11] buildType: [Debug, Release] - runs-on: ${{ matrix.os }} + runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v3.1.0 @@ -433,11 +282,7 @@ jobs: ctest-options: -V macos-clang-darwinssl: - strategy: - matrix: - os: [macos-12, macos-11] - buildType: [Debug, Release] - runs-on: ${{ matrix.os }} + runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v3.1.0 @@ -452,16 +297,12 @@ jobs: source-dir: ${{ github.workspace }} cc: clang cxx: clang++ - build-type: ${{ matrix.buildType }} + build-type: Release run-test: true ctest-options: -V macos-clang-openssl-boost: - strategy: - matrix: - os: [macos-12, macos-11] - buildType: [Debug, Release] - runs-on: ${{ matrix.os }} + runs-on: macos-latest steps: - name: Install Boost run: brew install boost @@ -490,6 +331,6 @@ jobs: source-dir: ${{ github.workspace }} cc: clang cxx: clang++ - build-type: ${{ matrix.buildType }} + build-type: Release run-test: true ctest-options: -V From 8d37b2090bf948677e0f73de225d6bc22924fe0e Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Sat, 24 Jun 2023 15:13:02 +0200 Subject: [PATCH 11/18] Using sudo CI jobs not running inside a container --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cbdf6d38..9aa832383 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,9 +76,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Update package list - run: apt update + run: sudo apt update - name: Install Dependencies - run: apt install -y git libssl-dev libmbedtls-dev cmake build-essential + run: sudo apt install -y git libssl-dev libmbedtls-dev cmake build-essential - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.13 with: From a67cf926686e5c8ffcddffdbb260932aff9abcbb Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Thu, 3 Aug 2023 09:52:11 +0200 Subject: [PATCH 12/18] Removed code QL CI since we are using clang tidy and cppcheck --- .github/workflows/codeql-analysis.yml | 71 --------------------------- 1 file changed, 71 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 0ecf2fe23..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,71 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '25 20 * * 3' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 From ef44df150467b7ebb2ec6a4fb486202c137d4eb8 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Thu, 3 Aug 2023 09:58:43 +0200 Subject: [PATCH 13/18] Forcing a non interaction apt env for CI runs --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9aa832383..21a12ec32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,8 @@ jobs: run: apt update - name: Install Dependencies run: apt install -y git libssl-dev cmake build-essential clang libcurl4-openssl-dev + env: + DEBIAN_FRONTEND: noninteractive - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.13 with: @@ -50,6 +52,8 @@ jobs: run: apt update - name: Install Dependencies run: apt install -y git libssl-dev cmake build-essential libcurl4-openssl-dev + env: + DEBIAN_FRONTEND: noninteractive - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.13 with: @@ -79,6 +83,8 @@ jobs: run: sudo apt update - name: Install Dependencies run: sudo apt install -y git libssl-dev libmbedtls-dev cmake build-essential + env: + DEBIAN_FRONTEND: noninteractive - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.13 with: From 85af108cbb94cc03d31613499d7fdafaf2c90235 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Thu, 3 Aug 2023 10:37:14 +0200 Subject: [PATCH 14/18] Using a known bad url for proxy CI tests --- test/error_tests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/error_tests.cpp b/test/error_tests.cpp index 13831ef5f..e3dc0e20b 100644 --- a/test/error_tests.cpp +++ b/test/error_tests.cpp @@ -73,7 +73,7 @@ TEST(ErrorTests, LowSpeedBytesFailure) { TEST(ErrorTests, ProxyFailure) { Url url{server->GetBaseUrl() + "/hello.html"}; - Response response = cpr::Get(url, cpr::Proxies{{"http", "http://bad_host/"}}); + Response response = cpr::Get(url, cpr::Proxies{{"http", "http://bad_host.libcpr.org"}}); EXPECT_EQ(url, response.url); EXPECT_EQ(0, response.status_code); EXPECT_EQ(ErrorCode::PROXY_RESOLUTION_FAILURE, response.error.code); From f8843fefbdd7163050e38c57f386f6c17eb1d912 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Thu, 3 Aug 2023 10:47:09 +0200 Subject: [PATCH 15/18] Trying up to 10 times to find a free local port --- test/session_tests.cpp | 72 ++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 23 deletions(-) diff --git a/test/session_tests.cpp b/test/session_tests.cpp index f298c88b0..33c18d6b7 100644 --- a/test/session_tests.cpp +++ b/test/session_tests.cpp @@ -1019,20 +1019,33 @@ TEST(CurlHolderManipulateTests, CustomOptionTest) { TEST(LocalPortTests, SetLocalPortTest) { Url url{server->GetBaseUrl() + "/local_port.html"}; Session session; - session.SetUrl(url); - std::uint16_t const local_port = 60252; // beware of HttpServer::GetPort when changing - std::uint16_t const local_port_range = 5000; - session.SetLocalPort(local_port); - session.SetLocalPortRange(local_port_range); - // expected response: body contains port number in specified range - // NOTE: even when trying up to 5000 ports there is the chance that all of them are occupied. - // It would be possible to also check here for ErrorCode::INTERNAL_ERROR but that somehow seems - // wrong as then this test would pass in case SetLocalPort does not work at all - // or in other words: we have to assume that at least one port in the specified range is free. - Response response = session.Get(); + uint16_t local_port{0}; + uint16_t local_port_range{0}; + Response response; + + // Try up to 10 times to get a free local port + for (size_t i = 0; i < 10; i++) { + session.SetUrl(url); + local_port = 40252 + (i * 100); // beware of HttpServer::GetPort when changing + local_port_range = 7000; + session.SetLocalPort(local_port); + session.SetLocalPortRange(local_port_range); + // expected response: body contains port number in specified range + // NOTE: even when trying up to 7000 ports there is the chance that all of them are occupied. + // It would be possible to also check here for ErrorCode::INTERNAL_ERROR but that somehow seems + // wrong as then this test would pass in case SetLocalPort does not work at all + // or in other words: we have to assume that at least one port in the specified range is free. + response = session.Get(); + + if (response.error.code != ErrorCode::INTERNAL_ERROR) { + break; + } + } + EXPECT_EQ(200, response.status_code); EXPECT_EQ(ErrorCode::OK, response.error.code); - std::uint16_t port_from_response = std::strtoul(response.text.c_str(), nullptr, 10); + // NOLINTNEXTLINE(google-runtime-int) + unsigned long port_from_response = std::strtoul(response.text.c_str(), nullptr, 10); EXPECT_EQ(errno, 0); EXPECT_GE(port_from_response, local_port); EXPECT_LE(port_from_response, local_port + local_port_range); @@ -1041,19 +1054,32 @@ TEST(LocalPortTests, SetLocalPortTest) { TEST(LocalPortTests, SetOptionTest) { Url url{server->GetBaseUrl() + "/local_port.html"}; Session session; - session.SetUrl(url); - std::uint16_t const local_port = 60551; // beware of HttpServer::GetPort when changing - std::uint16_t const local_port_range = 5000; - session.SetOption(LocalPort(local_port)); - session.SetOption(LocalPortRange(local_port_range)); - // expected response: body contains port number in specified range - // NOTE: even when trying up to 5000 ports there is the chance that all of them are occupied. - // It would be possible to also check here for ErrorCode::INTERNAL_ERROR but that somehow seems - // wrong as then this test would pass in case SetOption(LocalPort) does not work at all - // or in other words: we have to assume that at least one port in the specified range is free. - Response response = session.Get(); + uint16_t local_port{0}; + uint16_t local_port_range{0}; + Response response; + + // Try up to 10 times to get a free local port + for (size_t i = 0; i < 10; i++) { + session.SetUrl(url); + local_port = 30252 + (i * 100); // beware of HttpServer::GetPort when changing + local_port_range = 7000; + session.SetOption(LocalPort(local_port)); + session.SetOption(LocalPortRange(local_port_range)); + // expected response: body contains port number in specified range + // NOTE: even when trying up to 7000 ports there is the chance that all of them are occupied. + // It would be possible to also check here for ErrorCode::INTERNAL_ERROR but that somehow seems + // wrong as then this test would pass in case SetLocalPort does not work at all + // or in other words: we have to assume that at least one port in the specified range is free. + response = session.Get(); + + if (response.error.code != ErrorCode::INTERNAL_ERROR) { + break; + } + } + EXPECT_EQ(200, response.status_code); EXPECT_EQ(ErrorCode::OK, response.error.code); + // NOLINTNEXTLINE(google-runtime-int) unsigned long port_from_response = std::strtoul(response.text.c_str(), nullptr, 10); EXPECT_EQ(errno, 0); EXPECT_GE(port_from_response, local_port); From 06e7bbf78db46d1ef3747a2cece1decf9832c1d5 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Thu, 3 Aug 2023 10:49:04 +0200 Subject: [PATCH 16/18] Removed the cmake generator for macos --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21a12ec32..c525daa07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -321,7 +321,6 @@ jobs: uses: actions/checkout@v3.1.0 - name: "Build & Test" env: - CMAKE_GENERATOR: "Visual Studio 16 2019" CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: OFF CPR_USE_BOOST_FILESYSTEM: ON From 9f491e68391f891624311cf5939848510da2fe46 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Thu, 3 Aug 2023 11:08:08 +0200 Subject: [PATCH 17/18] Callback test using cost ref for args --- test/callback_tests.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/test/callback_tests.cpp b/test/callback_tests.cpp index 834f960a9..8ef8c0bb3 100644 --- a/test/callback_tests.cpp +++ b/test/callback_tests.cpp @@ -328,9 +328,10 @@ TEST(CallbackHeadTests, CallbackHeadFunctionTextReferenceTest) { TEST(CallbackPostTests, CallbackPostLambdaStatusTest) { Url url{server->GetBaseUrl() + "/url_post.html"}; Payload payload{{"x", "5"}}; - int status_code = 0; + // NOLINTNEXTLINE(google-runtime-int) + long status_code = 0; auto future = cpr::PostCallback( - [&status_code](Response r) { + [&status_code](const Response& r) { status_code = r.status_code; return r.status_code; }, @@ -345,7 +346,7 @@ TEST(CallbackPostTests, CallbackPostLambdaTextTest) { Payload payload{{"x", "5"}}; std::string expected_text{}; auto future = cpr::PostCallback( - [&expected_text](Response r) { + [&expected_text](const Response& r) { expected_text = r.text; return r.text; }, @@ -358,7 +359,8 @@ TEST(CallbackPostTests, CallbackPostLambdaTextTest) { TEST(CallbackPostTests, CallbackPostLambdaStatusReferenceTest) { Url url{server->GetBaseUrl() + "/url_post.html"}; Payload payload{{"x", "5"}}; - int status_code = 0; + // NOLINTNEXTLINE(google-runtime-int) + long status_code = 0; auto future = cpr::PostCallback( [&status_code](const Response& r) { status_code = r.status_code; @@ -863,7 +865,7 @@ TEST(CallbackDataTests, CallbackHeaderFunctionTextTest) { Url url{server->GetBaseUrl() + "/url_post.html"}; std::vector expected_headers{"HTTP/1.1 201 Created\r\n", "Content-Type: application/json\r\n", "\r\n"}; std::set response_headers; - Post(url, HeaderCallback{[&response_headers](std::string header, intptr_t /*userdata*/) -> bool { + Post(url, HeaderCallback{[&response_headers](const std::string& header, intptr_t /*userdata*/) -> bool { response_headers.insert(header); return true; }}); @@ -886,7 +888,7 @@ TEST(CallbackDataTests, CallbackWriteFunctionTextTest) { " \"x\": 5\n" "}"}; std::string response_text; - Post(url, Payload{{"x", "5"}}, WriteCallback{[&response_text](std::string header, intptr_t /*userdata*/) -> bool { + Post(url, Payload{{"x", "5"}}, WriteCallback{[&response_text](const std::string& header, intptr_t /*userdata*/) -> bool { response_text.append(header); return true; }}); @@ -902,7 +904,8 @@ TEST(CallbackDataTests, CallbackProgressFunctionCancelTest) { TEST(CallbackDataTests, CallbackProgressFunctionTotalTest) { Url url{server->GetBaseUrl() + "/url_post.html"}; Body body{"x=5"}; - size_t response_upload = 0, response_download = 0; + size_t response_upload = 0; + size_t response_download = 0; Response response = Post(url, body, ProgressCallback{[&](size_t downloadTotal, size_t /*downloadNow*/, size_t uploadTotal, size_t /*uploadNow*/, intptr_t /*userdata*/) -> bool { response_upload = uploadTotal; response_download = downloadTotal; @@ -916,7 +919,7 @@ TEST(CallbackDataTests, CallbackDebugFunctionTextTest) { Url url{server->GetBaseUrl() + "/url_post.html"}; Body body{"x=5"}; std::string debug_body; - Response response = Post(url, body, DebugCallback{[&](DebugCallback::InfoType type, std::string data, intptr_t /*userdata*/) { + Response response = Post(url, body, DebugCallback{[&](DebugCallback::InfoType type, const std::string& data, intptr_t /*userdata*/) { if (type == DebugCallback::InfoType::DATA_OUT) { debug_body = data; } From 4b0065cfc51d29f47afe7b3e842176186e867211 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Thu, 3 Aug 2023 11:16:35 +0200 Subject: [PATCH 18/18] Using push and workflow_dispatch as CI trigger --- .github/workflows/ci.yml | 2 +- .github/workflows/clang-format.yml | 2 +- .github/workflows/clang-tidy.yml | 2 +- .github/workflows/cppcheck.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c525daa07..0dc8f3868 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,5 @@ name: CI -on: [push, workflow_dispatch, pull_request] +on: [push, workflow_dispatch] jobs: ubuntu-clang-openssl: diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 2f194b87e..04643faac 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,6 +1,6 @@ name: "Test Clang Format" -on: [push, pull_request] +on: [push, workflow_dispatch] jobs: clang-format: diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 145fec855..4a6c8183e 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -1,6 +1,6 @@ name: "Test Clang Tidy" -on: [push, pull_request] +on: [push, workflow_dispatch] jobs: clang-tidy: diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml index 5834f37e6..d56c12de8 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/cppcheck.yml @@ -1,6 +1,6 @@ name: "Test cppcheck" -on: [push, pull_request] +on: [push, workflow_dispatch] jobs: cppcheck: