Skip to content

Commit 3591f20

Browse files
authored
Merge pull request #1116 from libcpr/feature/release_preperation_1.9.8
Preperation For 1.9.8 Release
2 parents 3cb2eae + 3125d91 commit 3591f20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+449
-179
lines changed

.clang-tidy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ Checks: '*,
3434
-modernize-return-braced-init-list,
3535
-cppcoreguidelines-avoid-magic-numbers,
3636
-readability-magic-numbers,
37-
-cppcoreguidelines-avoid-do-while
37+
-cppcoreguidelines-avoid-do-while,
38+
-cppcoreguidelines-rvalue-reference-param-not-moved,
39+
-misc-header-include-cycle
3840
'
3941
WarningsAsErrors: '*'
4042
HeaderFilterRegex: 'src/*.hpp'

.github/workflows/build-deb.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Build Debian Package
22
on:
33
push:
4-
tags:
5-
- 1.**
6-
pull_request:
4+
tags: [ '[0-9]+.[0-9]+.[0-9]+' ]
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: 'The optional semantic version number. If not supplied the branch/tag will be used.'
9+
type: string
710

811
jobs:
912
package-ubuntu-latest-amd64:
@@ -21,12 +24,26 @@ jobs:
2124
- name: "Install cpr dependencies"
2225
run: sudo apt install -y libssl-dev libcurl4-openssl-dev
2326
- name: "Install building tools"
24-
run: sudo apt install cmake debmake devscripts debhelper
25-
27+
run: sudo apt install -y cmake debmake devscripts debhelper
28+
# Set version number
29+
- name: Set version based on input
30+
if: ${{ inputs.version }}
31+
run: echo "RELEASE_VERSION=${{ inputs.version }}" >> "$GITHUB_ENV"
32+
- name: Set version based on ref
33+
if: ${{ !inputs.version }}
34+
run: |
35+
mkdir -p cpr/build
36+
pushd cpr/build
37+
cmake .. -DCPR_BUILD_VERSION_OUTPUT_ONLY=ON
38+
echo "RELEASE_VERSION=$(cat version.txt)" >> $GITHUB_ENV
39+
popd
40+
rm -rf cpr/build
41+
- name: Print Version
42+
run: echo "deb version will be '${{ env.RELEASE_VERSION }}'"
2643
# Build package of runtime library
2744
- name: "Package build of runtime library"
2845
env:
29-
VERSION: ${{ github.ref_name }}
46+
VERSION: ${{ env.RELEASE_VERSION }}
3047
run: bash cpr/package-build/build-package.sh cpr
3148

3249
- name: "Upload deb-packages"

.github/workflows/ci.yml

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
name: CI
22
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.
33

4+
env:
5+
# Enable verbose output.
6+
# Repeat up to 5 times to deal with flaky tests.
7+
CTEST_OPTIONS: "-V --repeat until-pass:5"
8+
# The OpenSSL path for CI runs. Found via 'brew info openssl'.
9+
MACOS_OPENSSL_ROOT_DIR: "/opt/homebrew/Cellar/openssl@3/3.3.0"
10+
411
jobs:
512
ubuntu-clang-openssl:
613
strategy:
714
matrix:
8-
container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"]
15+
container: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04", "ubuntu:24.04"]
916
systemCurl: [ON, OFF]
1017
buildType: [Debug, Release]
1118
runs-on: ubuntu-latest
@@ -18,7 +25,7 @@ jobs:
1825
env:
1926
DEBIAN_FRONTEND: noninteractive
2027
- name: Setup cmake
21-
uses: jwlawson/actions-setup-cmake@v1.13
28+
uses: jwlawson/actions-setup-cmake@v1.14
2229
with:
2330
cmake-version: '3.22.x'
2431
- name: Checkout
@@ -37,12 +44,12 @@ jobs:
3744
cxx: clang++
3845
build-type: ${{ matrix.buildType }}
3946
run-test: true
40-
ctest-options: -V
47+
ctest-options: ${{ env.CTEST_OPTIONS }}
4148

4249
ubuntu-gcc-openssl:
4350
strategy:
4451
matrix:
45-
container: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"]
52+
container: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04", "ubuntu:24.04"]
4653
systemCurl: [ON, OFF]
4754
buildType: [Debug, Release]
4855
runs-on: ubuntu-latest
@@ -55,7 +62,7 @@ jobs:
5562
env:
5663
DEBIAN_FRONTEND: noninteractive
5764
- name: Setup cmake
58-
uses: jwlawson/actions-setup-cmake@v1.13
65+
uses: jwlawson/actions-setup-cmake@v1.14
5966
with:
6067
cmake-version: '3.22.x'
6168
- name: Checkout
@@ -74,7 +81,7 @@ jobs:
7481
cxx: g++
7582
build-type: ${{ matrix.buildType }}
7683
run-test: true
77-
ctest-options: -V
84+
ctest-options: ${{ env.CTEST_OPTIONS }}
7885

7986
ubuntu-gcc-mbedtls:
8087
runs-on: ubuntu-latest
@@ -86,7 +93,7 @@ jobs:
8693
env:
8794
DEBIAN_FRONTEND: noninteractive
8895
- name: Setup cmake
89-
uses: jwlawson/actions-setup-cmake@v1.13
96+
uses: jwlawson/actions-setup-cmake@v1.14
9097
with:
9198
cmake-version: '3.22.x'
9299
- name: Checkout
@@ -104,7 +111,7 @@ jobs:
104111
cxx: g++
105112
build-type: Release
106113
run-test: true
107-
ctest-options: -V
114+
ctest-options: ${{ env.CTEST_OPTIONS }}
108115

109116
fedora-clang-openssl:
110117
strategy:
@@ -133,7 +140,7 @@ jobs:
133140
cxx: clang++
134141
build-type: Release
135142
run-test: true
136-
ctest-options: -V
143+
ctest-options: ${{ env.CTEST_OPTIONS }}
137144

138145
fedora-gcc-openssl:
139146
strategy:
@@ -164,7 +171,7 @@ jobs:
164171
cxx: g++
165172
build-type: ${{ matrix.buildType }}
166173
run-test: true
167-
ctest-options: -V
174+
ctest-options: ${{ env.CTEST_OPTIONS }}
168175

169176
fedora-gcc-ssl-sanitizer:
170177
strategy:
@@ -191,7 +198,7 @@ jobs:
191198
cxx: g++
192199
build-type: ${{ matrix.buildType }}
193200
run-test: true
194-
ctest-options: -V
201+
ctest-options: ${{ env.CTEST_OPTIONS }}
195202

196203
windows-msvc-ssl:
197204
strategy:
@@ -212,7 +219,7 @@ jobs:
212219
source-dir: ${{ github.workspace }}
213220
build-type: ${{ matrix.buildType }}
214221
run-test: true
215-
ctest-options: -V
222+
ctest-options: ${{ env.CTEST_OPTIONS }}
216223

217224
windows-msvc-openssl:
218225
runs-on: windows-latest
@@ -233,28 +240,25 @@ jobs:
233240
source-dir: ${{ github.workspace }}
234241
build-type: Release
235242
run-test: true
236-
ctest-options: -V
243+
ctest-options: ${{ env.CTEST_OPTIONS }}
237244

238245
macos-clang-openssl:
239246
runs-on: macos-latest
240247
steps:
241248
- name: Install OpenSSL
242-
run: |
243-
brew install openssl
244-
echo 'export PATH="/usr/local/opt/openssl@3/bin:$PATH"' >> /Users/runner/.bash_profile
245-
source ~/.bash_profile
246-
export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
247-
export CPPFLAGS="-I/usr/local/opt/openssl@3/include"
248-
export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"
249+
run: brew install openssl
249250
- name: Checkout
250-
uses: actions/checkout@v3.1.0
251+
uses: actions/checkout@v3
251252
- name: "Build & Test"
252253
env:
253254
CPR_BUILD_TESTS: ON
254255
CPR_BUILD_TESTS_SSL: ON
255256
CPR_FORCE_OPENSSL_BACKEND: ON
256-
OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@3"
257-
OPENSSL_LIBRARIES: "/usr/local/opt/openssl@3/lib"
257+
OPENSSL_ROOT_DIR: "${{ env.MACOS_OPENSSL_ROOT_DIR }}"
258+
OPENSSL_LIBRARIES: "${{ env.MACOS_OPENSSL_ROOT_DIR }}/lib"
259+
LDFLAGS: "-L${{ env.MACOS_OPENSSL_ROOT_DIR }}/lib"
260+
CPPFLAGS: "-I${{ env.MACOS_OPENSSL_ROOT_DIR }}/include"
261+
PKG_CONFIG_PATH: "${{ env.MACOS_OPENSSL_ROOT_DIR }}/lib/pkgconfig"
258262
uses: ashutoshvarma/action-cmake-build@master
259263
with:
260264
build-dir: ${{ github.workspace }}/build
@@ -263,7 +267,7 @@ jobs:
263267
cxx: clang++
264268
build-type: Release
265269
run-test: true
266-
ctest-options: -V
270+
ctest-options: ${{ env.CTEST_OPTIONS }}
267271

268272
macos-clang-ssl:
269273
strategy:
@@ -285,7 +289,7 @@ jobs:
285289
cxx: clang++
286290
build-type: ${{ matrix.buildType }}
287291
run-test: true
288-
ctest-options: -V
292+
ctest-options: ${{ env.CTEST_OPTIONS }}
289293

290294
macos-clang-darwinssl:
291295
runs-on: macos-latest
@@ -305,31 +309,28 @@ jobs:
305309
cxx: clang++
306310
build-type: Release
307311
run-test: true
308-
ctest-options: -V
312+
ctest-options: ${{ env.CTEST_OPTIONS }}
309313

310314
macos-clang-openssl-boost:
311315
runs-on: macos-latest
312316
steps:
313317
- name: Install Boost
314318
run: brew install boost
315319
- name: Install OpenSSL
316-
run: |
317-
brew install openssl
318-
echo 'export PATH="/usr/local/opt/openssl@3/bin:$PATH"' >> /Users/runner/.bash_profile
319-
source ~/.bash_profile
320+
run: brew install openssl
320321
- name: Checkout
321-
uses: actions/checkout@v3.1.0
322+
uses: actions/checkout@v3
322323
- name: "Build & Test"
323324
env:
324325
CPR_BUILD_TESTS: ON
325-
CPR_BUILD_TESTS_SSL: OFF
326-
CPR_USE_BOOST_FILESYSTEM: ON
326+
CPR_BUILD_TESTS_SSL: ON
327327
CPR_FORCE_OPENSSL_BACKEND: ON
328-
OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@3"
329-
OPENSSL_LIBRARIES: "/usr/local/opt/openssl@3/lib"
330-
LDFLAGS: "-L/usr/local/opt/openssl@3/lib"
331-
CPPFLAGS: "-I/usr/local/opt/openssl@3/include"
332-
PKG_CONFIG_PATH: "/usr/local/opt/openssl@3/lib/pkgconfig"
328+
CPR_USE_BOOST_FILESYSTEM: ON
329+
OPENSSL_ROOT_DIR: "${{ env.MACOS_OPENSSL_ROOT_DIR }}"
330+
OPENSSL_LIBRARIES: "${{ env.MACOS_OPENSSL_ROOT_DIR }}/lib"
331+
LDFLAGS: "-L${{ env.MACOS_OPENSSL_ROOT_DIR }}/lib"
332+
CPPFLAGS: "-I${{ env.MACOS_OPENSSL_ROOT_DIR }}/include"
333+
PKG_CONFIG_PATH: "${{ env.MACOS_OPENSSL_ROOT_DIR }}/lib/pkgconfig"
333334
uses: ashutoshvarma/action-cmake-build@master
334335
with:
335336
build-dir: ${{ github.workspace }}/build
@@ -338,4 +339,4 @@ jobs:
338339
cxx: clang++
339340
build-type: Release
340341
run-test: true
341-
ctest-options: -V
342+
ctest-options: ${{ env.CTEST_OPTIONS }}

.github/workflows/clang-format.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ jobs:
99
steps:
1010
- name: Update package list
1111
run: sudo dnf update -y
12-
- name: Install dependencies
13-
run: sudo dnf install -y openssl-devel cmake git gcc clang ninja-build
14-
- name: Install clang-tidy
12+
- name: Install clang-format
1513
run: sudo dnf install -y clang-tools-extra
1614
- name: Checkout
1715
uses: actions/checkout@v3
1816
- name: Check format
19-
uses: RafikFarhad/[email protected]
17+
run: bash scripts/check_clang_format.sh

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ _site/
4646
.ycm_extra_conf.py*
4747

4848
# VSCode
49-
.vscode/
49+
.vscode/*
50+
!.vscode/tasks.json
5051
.vs/
52+
!.vs/tasks.json
5153

5254
# clangd
5355
.cache/

.vscode/tasks.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "🗑️ Delete build dir",
8+
"type": "shell",
9+
"command": "${workspaceFolder}/scripts/delete_build_dir.sh",
10+
"problemMatcher": [],
11+
"group": {
12+
"kind": "build"
13+
},
14+
"presentation": {
15+
"clear": true
16+
},
17+
"options": {
18+
"cwd": "${workspaceFolder}"
19+
}
20+
},
21+
{
22+
"label": "📝 Run clang-format",
23+
"type": "shell",
24+
"command": "${workspaceFolder}/scripts/run_clang_format.sh",
25+
"args": [
26+
"cpr",
27+
"include",
28+
"test"
29+
],
30+
"problemMatcher": [],
31+
"group": {
32+
"kind": "build"
33+
},
34+
"presentation": {
35+
"clear": true
36+
},
37+
"options": {
38+
"cwd": "${workspaceFolder}"
39+
}
40+
},
41+
{
42+
"label": "📑 Check clang-format",
43+
"type": "shell",
44+
"command": "${workspaceFolder}/scripts/check_clang_format.sh",
45+
"args": [
46+
"cpr",
47+
"include",
48+
"test"
49+
],
50+
"problemMatcher": [],
51+
"group": {
52+
"kind": "build"
53+
},
54+
"presentation": {
55+
"clear": true
56+
},
57+
"options": {
58+
"cwd": "${workspaceFolder}"
59+
}
60+
}
61+
]
62+
}

0 commit comments

Comments
 (0)