Skip to content

Commit bdc1e6d

Browse files
authored
Merge branch 'master' into unix_socket
2 parents 0bdbeaa + bd61a7d commit bdc1e6d

71 files changed

Lines changed: 1881 additions & 18496 deletions

Some content is hidden

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

.clang-format

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ ContinuationIndentWidth: '2'
4949
Cpp11BracedListStyle: 'true'
5050
FixNamespaceComments: 'true'
5151
IncludeBlocks: Regroup
52-
IncludeCategories:
52+
IncludeCategories:
5353
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
5454
Priority: 2
5555
SortPriority: 2
@@ -87,7 +87,7 @@ SpacesInCStyleCastParentheses: 'false'
8787
SpacesInContainerLiterals: 'false'
8888
SpacesInParentheses: 'false'
8989
SpacesInSquareBrackets: 'false'
90-
#SpacesInLineCommentPrefix:
90+
#SpacesInLineCommentPrefix:
9191
# Minimum: 1
9292
# Maximum: -1
9393
Standard: Cpp11
Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
name: Build and test
22

3-
#on: push
43
on:
54
push:
65
branches: [ "master" ]
76
pull_request:
87
branches: [ "master" ]
98

109
env:
11-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1210
BUILD_TYPE: Release
1311
COVERALLS_PULL_REQUEST: ${{ github.event.number }}
14-
#COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
1512

1613
jobs:
1714
build:
@@ -26,20 +23,22 @@ jobs:
2623
windows-latest,
2724
macos-latest,
2825
ubuntu-20.04,
29-
macos-11
26+
ubuntu-24.04,
27+
macos-13
3028
]
3129
# ubuntu-18.04 does not work due to compile error on asio
32-
# windows-2019 not included to spare free minutes
30+
# windows-2019 not included to spare free minutes
3331
steps:
3432
- uses: actions/checkout@v4
3533
- name: Prepare dependencies
36-
run: |
34+
run: |
3735
if [ "$RUNNER_OS" == "Linux" ]; then
3836
sudo apt-get update && \
3937
sudo apt-get install -yq \
4038
libasio-dev \
4139
libssl-dev zlib1g-dev \
42-
cmake
40+
cmake \
41+
g++ clang
4342
elif [ "$RUNNER_OS" == "Windows" ]; then
4443
VCPKG_DEFAULT_TRIPLET=x64-windows vcpkg install
4544
elif [ "$RUNNER_OS" == "macOS" ]; then
@@ -52,31 +51,33 @@ jobs:
5251

5352
- name: Configure CMake
5453
run: |
54+
cmake_flags=""
5555
if [ "$RUNNER_OS" == "Windows" ]; then
56-
cmake \
57-
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \
58-
-DCROW_ENABLE_SSL=ON \
59-
-DCROW_ENABLE_COMPRESSION=ON \
60-
-DCROW_AMALGAMATE=ON \
61-
-DCROW_BUILD_TESTS=ON \
62-
-B build
63-
elif [ "$RUNNER_OS" == "macOS" ]; then
64-
LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" \
65-
CPPFLAGS="-I/usr/local/opt/openssl@1.1/include" \
66-
cmake \
67-
-DCROW_ENABLE_SSL=ON \
68-
-DCROW_ENABLE_COMPRESSION=ON \
69-
-DCROW_AMALGAMATE=ON \
70-
-DCROW_BUILD_TESTS=ON \
71-
-B build
72-
else
73-
cmake \
74-
-DCROW_ENABLE_SSL=ON \
75-
-DCROW_ENABLE_COMPRESSION=ON \
76-
-DCROW_AMALGAMATE=ON \
77-
-DCROW_BUILD_TESTS=ON \
78-
-B build
79-
fi
56+
cmake_flags="-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
57+
elif [ "$RUNNER_OS" == "macOS" ]; then
58+
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
59+
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
60+
if [ "${{ matrix.compiler }}" == "clang" ] && [ "${{ matrix.cxx_stdlib }}" == "libc++" ]; then
61+
cmake_flags="-DCMAKE_CXX_FLAGS='-stdlib=libc++'"
62+
fi
63+
elif [ "$RUNNER_OS" == "Linux" ]; then
64+
if [ "${{ matrix.compiler }}" == "clang" ] && [ "${{ matrix.cxx_stdlib }}" == "libc++" ]; then
65+
cmake_flags="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS='-stdlib=libc++'"
66+
sudo apt-get install libc++-dev libc++abi-dev -y
67+
elif [ "${{ matrix.compiler }}" == "clang" ]; then
68+
cmake_flags="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS='-stdlib=libstdc++'"
69+
else
70+
cmake_flags="-DCMAKE_CXX_COMPILER=g++"
71+
fi
72+
fi
73+
74+
cmake \
75+
${cmake_flags} \
76+
-DCROW_ENABLE_SSL=ON \
77+
-DCROW_ENABLE_COMPRESSION=ON \
78+
-DCROW_AMALGAMATE=ON \
79+
-DCROW_BUILD_TESTS=ON \
80+
-B build
8081
shell: bash
8182

8283
- name: Build
@@ -89,12 +90,13 @@ jobs:
8990
# Execute tests defined by the CMake configuration.
9091
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
9192
run: ctest --output-on-failure -C ${{env.BUILD_TYPE}}
93+
shell: bash
9294

9395
- name: Generate coverage report
94-
if: matrix.os == 'ubuntu-latest'
96+
if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'gcc' && matrix.cxx_stdlib == 'libstdc++'
9597
run: |
9698
export CI_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
97-
echo "CI_BRANCH=$CI_BRANCH" >> $GITHUB_ENV && \
99+
echo "CI_BRANCH=$CI_BRANCH" >> $GITHUB_ENV && \
98100
export TRAVIS_JOB_ID=$GITHUB_RUN_NUMBER && \
99101
git clone https://github.com/CrowCpp/cpp-coveralls.git && \
100102
cd cpp-coveralls && \
@@ -103,19 +105,18 @@ jobs:
103105
coveralls --verbose --exclude-pattern .*/http_parser_merged.h --exclude-pattern .*/TinySHA1.hpp --dump coveralls.json
104106
shell: bash
105107

106-
107108
- name: Save report
108109
uses: actions/upload-artifact@v4
109-
if: matrix.os == 'ubuntu-latest'
110+
if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'gcc' && matrix.cxx_stdlib == 'libstdc++'
110111
with:
111112
name: coveralls.json
112113
path: coveralls.json
113114

114115

115116
#- name: Package
116117
# working-directory: ${{github.workspace}}/build
117-
# run: |
118-
# cmake --build . --target ALL_BUILD && \
118+
# run: |
119+
# cmake --build . --target ALL_BUILD && \
119120
# cmake --build . --target doc && \
120-
# cmake --build . --target package && \
121+
# cmake --build . --target package && \
121122
# cpack --config CPackSourceConfig.cmake

.github/workflows/cifuzz.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CIFuzz
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
permissions: {}
8+
jobs:
9+
Fuzzing:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
security-events: write
13+
steps:
14+
- name: Build Fuzzers
15+
id: build
16+
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
17+
with:
18+
oss-fuzz-project-name: 'crow'
19+
language: c++
20+
- name: Run Fuzzers
21+
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
22+
with:
23+
oss-fuzz-project-name: 'crow'
24+
language: c++
25+
fuzz-seconds: 800
26+
output-sarif: true
27+
- name: Upload Crash
28+
uses: actions/upload-artifact@v4
29+
if: failure() && steps.build.outcome == 'success'
30+
with:
31+
name: artifacts
32+
path: ./out/artifacts
33+
- name: Upload Sarif
34+
if: always() && steps.build.outcome == 'success'
35+
uses: github/codeql-action/upload-sarif@v3
36+
with:
37+
# Path to SARIF file relative to the root of the repository
38+
sarif_file: cifuzz-sarif/results.sarif
39+
checkout_path: cifuzz-sarif

.github/workflows/codeql.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
branches: [ "master" ]
19+
schedule:
20+
- cron: '38 17 * * 6'
21+
22+
jobs:
23+
analyze:
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
32+
permissions:
33+
# required for all workflows
34+
security-events: write
35+
36+
# required to fetch internal or private CodeQL packs
37+
packages: read
38+
39+
# only required for workflows in private repositories
40+
actions: read
41+
contents: read
42+
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
include:
47+
- language: c-cpp
48+
build-mode: autobuild
49+
- language: python
50+
build-mode: none
51+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
52+
# Use `c-cpp` to analyze code written in C, C++ or both
53+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
54+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
55+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
56+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
57+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
58+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
59+
steps:
60+
- name: Checkout repository
61+
uses: actions/checkout@v4
62+
63+
# Initializes the CodeQL tools for scanning.
64+
- name: Initialize CodeQL
65+
uses: github/codeql-action/init@v3
66+
with:
67+
languages: ${{ matrix.language }}
68+
build-mode: ${{ matrix.build-mode }}
69+
# If you wish to specify custom queries, you can do so here or in a config file.
70+
# By default, queries listed here will override any specified in a config file.
71+
# Prefix the list here with "+" to use these queries and those in the config file.
72+
73+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
74+
# queries: security-extended,security-and-quality
75+
76+
# If the analyze step fails for one of the languages you are analyzing with
77+
# "We were unable to automatically build your code", modify the matrix above
78+
# to set the build mode to "manual" for that language. Then modify this step
79+
# to build your code.
80+
# ℹ️ Command-line programs to run using the OS shell.
81+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
82+
- if: matrix.build-mode == 'manual'
83+
shell: bash
84+
run: |
85+
echo 'If you are using a "manual" build mode for one or more of the' \
86+
'languages you are analyzing, replace this with the commands to build' \
87+
'your code, for example:'
88+
echo ' make bootstrap'
89+
echo ' make release'
90+
exit 1
91+
92+
- name: Perform CodeQL Analysis
93+
uses: github/codeql-action/analyze@v3
94+
with:
95+
category: "/language:${{matrix.language}}"

.github/workflows/doxygen-gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: prepate pip dependencies
2121
run: pip3 install mkdocs-material mkdocs-redirects pyyaml mkdocs-meta-descriptions-plugin mike --no-input
2222
- name: configure
23-
run: cmake -B build -DCROW_AMALGAMATE=ON
23+
run: cmake -B build -DCROW_AMALGAMATE=ON
2424
- name: clean generated docs dir
2525
run: rm -rf site docs/reference
2626
- name: clone doxygen theme

.github/workflows/submit_coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
if: github.event.workflow_run.conclusion == 'success'
1717
steps:
1818
- name: Download artifact
19-
uses: dawidd6/action-download-artifact@v3
19+
uses: dawidd6/action-download-artifact@v6
2020
with:
2121
workflow: ${{ github.event.workflow_run.workflow_id }}
2222
workflow_conclusion: success

0 commit comments

Comments
 (0)