Skip to content

Commit

Permalink
Merge pull request #1116 from libcpr/feature/release_preperation_1.9.8
Browse files Browse the repository at this point in the history
Preperation For 1.9.8 Release
  • Loading branch information
COM8 authored Oct 13, 2024
2 parents 3cb2eae + 3125d91 commit 3591f20
Show file tree
Hide file tree
Showing 46 changed files with 449 additions and 179 deletions.
4 changes: 3 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ Checks: '*,
-modernize-return-braced-init-list,
-cppcoreguidelines-avoid-magic-numbers,
-readability-magic-numbers,
-cppcoreguidelines-avoid-do-while
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-rvalue-reference-param-not-moved,
-misc-header-include-cycle
'
WarningsAsErrors: '*'
HeaderFilterRegex: 'src/*.hpp'
Expand Down
29 changes: 23 additions & 6 deletions .github/workflows/build-deb.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Build Debian Package
on:
push:
tags:
- 1.**
pull_request:
tags: [ '[0-9]+.[0-9]+.[0-9]+' ]
workflow_dispatch:
inputs:
version:
description: 'The optional semantic version number. If not supplied the branch/tag will be used.'
type: string

jobs:
package-ubuntu-latest-amd64:
Expand All @@ -21,12 +24,26 @@ jobs:
- name: "Install cpr dependencies"
run: sudo apt install -y libssl-dev libcurl4-openssl-dev
- name: "Install building tools"
run: sudo apt install cmake debmake devscripts debhelper

run: sudo apt install -y cmake debmake devscripts debhelper
# Set version number
- name: Set version based on input
if: ${{ inputs.version }}
run: echo "RELEASE_VERSION=${{ inputs.version }}" >> "$GITHUB_ENV"
- name: Set version based on ref
if: ${{ !inputs.version }}
run: |
mkdir -p cpr/build
pushd cpr/build
cmake .. -DCPR_BUILD_VERSION_OUTPUT_ONLY=ON
echo "RELEASE_VERSION=$(cat version.txt)" >> $GITHUB_ENV
popd
rm -rf cpr/build
- name: Print Version
run: echo "deb version will be '${{ env.RELEASE_VERSION }}'"
# Build package of runtime library
- name: "Package build of runtime library"
env:
VERSION: ${{ github.ref_name }}
VERSION: ${{ env.RELEASE_VERSION }}
run: bash cpr/package-build/build-package.sh cpr

- name: "Upload deb-packages"
Expand Down
79 changes: 40 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
name: CI
on: [push, workflow_dispatch, pull_request] # Trigger for every push as well as for every pull request. Yes, this will run stuff twice in case we create a PR from inside this repo. I'm open for better solutions, where I do not have to specify each brach individually for the 'push' trigger.

env:
# Enable verbose output.
# Repeat up to 5 times to deal with flaky tests.
CTEST_OPTIONS: "-V --repeat until-pass:5"
# The OpenSSL path for CI runs. Found via 'brew info openssl'.
MACOS_OPENSSL_ROOT_DIR: "/opt/homebrew/Cellar/openssl@3/3.3.0"

jobs:
ubuntu-clang-openssl:
strategy:
matrix:
container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"]
container: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04", "ubuntu:24.04"]
systemCurl: [ON, OFF]
buildType: [Debug, Release]
runs-on: ubuntu-latest
Expand All @@ -18,7 +25,7 @@ jobs:
env:
DEBIAN_FRONTEND: noninteractive
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14
with:
cmake-version: '3.22.x'
- name: Checkout
Expand All @@ -37,12 +44,12 @@ jobs:
cxx: clang++
build-type: ${{ matrix.buildType }}
run-test: true
ctest-options: -V
ctest-options: ${{ env.CTEST_OPTIONS }}

ubuntu-gcc-openssl:
strategy:
matrix:
container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"]
container: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04", "ubuntu:24.04"]
systemCurl: [ON, OFF]
buildType: [Debug, Release]
runs-on: ubuntu-latest
Expand All @@ -55,7 +62,7 @@ jobs:
env:
DEBIAN_FRONTEND: noninteractive
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14
with:
cmake-version: '3.22.x'
- name: Checkout
Expand All @@ -74,7 +81,7 @@ jobs:
cxx: g++
build-type: ${{ matrix.buildType }}
run-test: true
ctest-options: -V
ctest-options: ${{ env.CTEST_OPTIONS }}

ubuntu-gcc-mbedtls:
runs-on: ubuntu-latest
Expand All @@ -86,7 +93,7 @@ jobs:
env:
DEBIAN_FRONTEND: noninteractive
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.13
uses: jwlawson/actions-setup-cmake@v1.14
with:
cmake-version: '3.22.x'
- name: Checkout
Expand All @@ -104,7 +111,7 @@ jobs:
cxx: g++
build-type: Release
run-test: true
ctest-options: -V
ctest-options: ${{ env.CTEST_OPTIONS }}

fedora-clang-openssl:
strategy:
Expand Down Expand Up @@ -133,7 +140,7 @@ jobs:
cxx: clang++
build-type: Release
run-test: true
ctest-options: -V
ctest-options: ${{ env.CTEST_OPTIONS }}

fedora-gcc-openssl:
strategy:
Expand Down Expand Up @@ -164,7 +171,7 @@ jobs:
cxx: g++
build-type: ${{ matrix.buildType }}
run-test: true
ctest-options: -V
ctest-options: ${{ env.CTEST_OPTIONS }}

fedora-gcc-ssl-sanitizer:
strategy:
Expand All @@ -191,7 +198,7 @@ jobs:
cxx: g++
build-type: ${{ matrix.buildType }}
run-test: true
ctest-options: -V
ctest-options: ${{ env.CTEST_OPTIONS }}

windows-msvc-ssl:
strategy:
Expand All @@ -212,7 +219,7 @@ jobs:
source-dir: ${{ github.workspace }}
build-type: ${{ matrix.buildType }}
run-test: true
ctest-options: -V
ctest-options: ${{ env.CTEST_OPTIONS }}

windows-msvc-openssl:
runs-on: windows-latest
Expand All @@ -233,28 +240,25 @@ jobs:
source-dir: ${{ github.workspace }}
build-type: Release
run-test: true
ctest-options: -V
ctest-options: ${{ env.CTEST_OPTIONS }}

macos-clang-openssl:
runs-on: macos-latest
steps:
- 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"
run: brew install openssl
- name: Checkout
uses: actions/checkout@v3.1.0
uses: actions/checkout@v3
- name: "Build & Test"
env:
CPR_BUILD_TESTS: ON
CPR_BUILD_TESTS_SSL: ON
CPR_FORCE_OPENSSL_BACKEND: ON
OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@3"
OPENSSL_LIBRARIES: "/usr/local/opt/openssl@3/lib"
OPENSSL_ROOT_DIR: "${{ env.MACOS_OPENSSL_ROOT_DIR }}"
OPENSSL_LIBRARIES: "${{ env.MACOS_OPENSSL_ROOT_DIR }}/lib"
LDFLAGS: "-L${{ env.MACOS_OPENSSL_ROOT_DIR }}/lib"
CPPFLAGS: "-I${{ env.MACOS_OPENSSL_ROOT_DIR }}/include"
PKG_CONFIG_PATH: "${{ env.MACOS_OPENSSL_ROOT_DIR }}/lib/pkgconfig"
uses: ashutoshvarma/action-cmake-build@master
with:
build-dir: ${{ github.workspace }}/build
Expand All @@ -263,7 +267,7 @@ jobs:
cxx: clang++
build-type: Release
run-test: true
ctest-options: -V
ctest-options: ${{ env.CTEST_OPTIONS }}

macos-clang-ssl:
strategy:
Expand All @@ -285,7 +289,7 @@ jobs:
cxx: clang++
build-type: ${{ matrix.buildType }}
run-test: true
ctest-options: -V
ctest-options: ${{ env.CTEST_OPTIONS }}

macos-clang-darwinssl:
runs-on: macos-latest
Expand All @@ -305,31 +309,28 @@ jobs:
cxx: clang++
build-type: Release
run-test: true
ctest-options: -V
ctest-options: ${{ env.CTEST_OPTIONS }}

macos-clang-openssl-boost:
runs-on: macos-latest
steps:
- name: Install Boost
run: brew install boost
- name: Install OpenSSL
run: |
brew install openssl
echo 'export PATH="/usr/local/opt/openssl@3/bin:$PATH"' >> /Users/runner/.bash_profile
source ~/.bash_profile
run: brew install openssl
- name: Checkout
uses: actions/checkout@v3.1.0
uses: actions/checkout@v3
- name: "Build & Test"
env:
CPR_BUILD_TESTS: ON
CPR_BUILD_TESTS_SSL: OFF
CPR_USE_BOOST_FILESYSTEM: ON
CPR_BUILD_TESTS_SSL: ON
CPR_FORCE_OPENSSL_BACKEND: ON
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"
CPR_USE_BOOST_FILESYSTEM: ON
OPENSSL_ROOT_DIR: "${{ env.MACOS_OPENSSL_ROOT_DIR }}"
OPENSSL_LIBRARIES: "${{ env.MACOS_OPENSSL_ROOT_DIR }}/lib"
LDFLAGS: "-L${{ env.MACOS_OPENSSL_ROOT_DIR }}/lib"
CPPFLAGS: "-I${{ env.MACOS_OPENSSL_ROOT_DIR }}/include"
PKG_CONFIG_PATH: "${{ env.MACOS_OPENSSL_ROOT_DIR }}/lib/pkgconfig"
uses: ashutoshvarma/action-cmake-build@master
with:
build-dir: ${{ github.workspace }}/build
Expand All @@ -338,4 +339,4 @@ jobs:
cxx: clang++
build-type: Release
run-test: true
ctest-options: -V
ctest-options: ${{ env.CTEST_OPTIONS }}
6 changes: 2 additions & 4 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ jobs:
steps:
- name: Update package list
run: sudo dnf update -y
- name: Install dependencies
run: sudo dnf install -y openssl-devel cmake git gcc clang ninja-build
- name: Install clang-tidy
- name: Install clang-format
run: sudo dnf install -y clang-tools-extra
- name: Checkout
uses: actions/checkout@v3
- name: Check format
uses: RafikFarhad/clang-format-github-action@v2.1.0
run: bash scripts/check_clang_format.sh
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ _site/
.ycm_extra_conf.py*

# VSCode
.vscode/
.vscode/*
!.vscode/tasks.json
.vs/
!.vs/tasks.json

# clangd
.cache/
Expand Down
62 changes: 62 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "🗑️ Delete build dir",
"type": "shell",
"command": "${workspaceFolder}/scripts/delete_build_dir.sh",
"problemMatcher": [],
"group": {
"kind": "build"
},
"presentation": {
"clear": true
},
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "📝 Run clang-format",
"type": "shell",
"command": "${workspaceFolder}/scripts/run_clang_format.sh",
"args": [
"cpr",
"include",
"test"
],
"problemMatcher": [],
"group": {
"kind": "build"
},
"presentation": {
"clear": true
},
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "📑 Check clang-format",
"type": "shell",
"command": "${workspaceFolder}/scripts/check_clang_format.sh",
"args": [
"cpr",
"include",
"test"
],
"problemMatcher": [],
"group": {
"kind": "build"
},
"presentation": {
"clear": true
},
"options": {
"cwd": "${workspaceFolder}"
}
}
]
}
Loading

0 comments on commit 3591f20

Please sign in to comment.