Skip to content

Commit

Permalink
Merge branch 'master' into unix_socket
Browse files Browse the repository at this point in the history
  • Loading branch information
The-EDev authored Oct 25, 2024
2 parents 0bdbeaa + bd61a7d commit bdc1e6d
Show file tree
Hide file tree
Showing 71 changed files with 1,881 additions and 18,496 deletions.
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ContinuationIndentWidth: '2'
Cpp11BracedListStyle: 'true'
FixNamespaceComments: 'true'
IncludeBlocks: Regroup
IncludeCategories:
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 2
Expand Down Expand Up @@ -87,7 +87,7 @@ SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
#SpacesInLineCommentPrefix:
#SpacesInLineCommentPrefix:
# Minimum: 1
# Maximum: -1
Standard: Cpp11
Expand Down
77 changes: 39 additions & 38 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
name: Build and test

#on: push
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
COVERALLS_PULL_REQUEST: ${{ github.event.number }}
#COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

jobs:
build:
Expand All @@ -26,20 +23,22 @@ jobs:
windows-latest,
macos-latest,
ubuntu-20.04,
macos-11
ubuntu-24.04,
macos-13
]
# ubuntu-18.04 does not work due to compile error on asio
# windows-2019 not included to spare free minutes
# windows-2019 not included to spare free minutes
steps:
- uses: actions/checkout@v4
- name: Prepare dependencies
run: |
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update && \
sudo apt-get install -yq \
libasio-dev \
libssl-dev zlib1g-dev \
cmake
cmake \
g++ clang
elif [ "$RUNNER_OS" == "Windows" ]; then
VCPKG_DEFAULT_TRIPLET=x64-windows vcpkg install
elif [ "$RUNNER_OS" == "macOS" ]; then
Expand All @@ -52,31 +51,33 @@ jobs:

- name: Configure CMake
run: |
cmake_flags=""
if [ "$RUNNER_OS" == "Windows" ]; then
cmake \
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCROW_ENABLE_SSL=ON \
-DCROW_ENABLE_COMPRESSION=ON \
-DCROW_AMALGAMATE=ON \
-DCROW_BUILD_TESTS=ON \
-B build
elif [ "$RUNNER_OS" == "macOS" ]; then
LDFLAGS="-L/usr/local/opt/[email protected]/lib" \
CPPFLAGS="-I/usr/local/opt/[email protected]/include" \
cmake \
-DCROW_ENABLE_SSL=ON \
-DCROW_ENABLE_COMPRESSION=ON \
-DCROW_AMALGAMATE=ON \
-DCROW_BUILD_TESTS=ON \
-B build
else
cmake \
-DCROW_ENABLE_SSL=ON \
-DCROW_ENABLE_COMPRESSION=ON \
-DCROW_AMALGAMATE=ON \
-DCROW_BUILD_TESTS=ON \
-B build
fi
cmake_flags="-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
elif [ "$RUNNER_OS" == "macOS" ]; then
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
if [ "${{ matrix.compiler }}" == "clang" ] && [ "${{ matrix.cxx_stdlib }}" == "libc++" ]; then
cmake_flags="-DCMAKE_CXX_FLAGS='-stdlib=libc++'"
fi
elif [ "$RUNNER_OS" == "Linux" ]; then
if [ "${{ matrix.compiler }}" == "clang" ] && [ "${{ matrix.cxx_stdlib }}" == "libc++" ]; then
cmake_flags="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS='-stdlib=libc++'"
sudo apt-get install libc++-dev libc++abi-dev -y
elif [ "${{ matrix.compiler }}" == "clang" ]; then
cmake_flags="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS='-stdlib=libstdc++'"
else
cmake_flags="-DCMAKE_CXX_COMPILER=g++"
fi
fi
cmake \
${cmake_flags} \
-DCROW_ENABLE_SSL=ON \
-DCROW_ENABLE_COMPRESSION=ON \
-DCROW_AMALGAMATE=ON \
-DCROW_BUILD_TESTS=ON \
-B build
shell: bash

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

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


- name: Save report
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'gcc' && matrix.cxx_stdlib == 'libstdc++'
with:
name: coveralls.json
path: coveralls.json


#- name: Package
# working-directory: ${{github.workspace}}/build
# run: |
# cmake --build . --target ALL_BUILD && \
# run: |
# cmake --build . --target ALL_BUILD && \
# cmake --build . --target doc && \
# cmake --build . --target package && \
# cmake --build . --target package && \
# cpack --config CPackSourceConfig.cmake
39 changes: 39 additions & 0 deletions .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CIFuzz
on:
push:
branches:
- master
pull_request:
permissions: {}
jobs:
Fuzzing:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'crow'
language: c++
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'crow'
language: c++
fuzz-seconds: 800
output-sarif: true
- name: Upload Crash
uses: actions/upload-artifact@v4
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts
- name: Upload Sarif
if: always() && steps.build.outcome == 'success'
uses: github/codeql-action/upload-sarif@v3
with:
# Path to SARIF file relative to the root of the repository
sarif_file: cifuzz-sarif/results.sarif
checkout_path: cifuzz-sarif
95 changes: 95 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# 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:
branches: [ "master" ]
schedule:
- cron: '38 17 * * 6'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: c-cpp
build-mode: autobuild
- language: python
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# 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
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# 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.

# 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
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/doxygen-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: prepate pip dependencies
run: pip3 install mkdocs-material mkdocs-redirects pyyaml mkdocs-meta-descriptions-plugin mike --no-input
- name: configure
run: cmake -B build -DCROW_AMALGAMATE=ON
run: cmake -B build -DCROW_AMALGAMATE=ON
- name: clean generated docs dir
run: rm -rf site docs/reference
- name: clone doxygen theme
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/submit_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@v3
uses: dawidd6/action-download-artifact@v6
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: success
Expand Down
Loading

0 comments on commit bdc1e6d

Please sign in to comment.