Skip to content

Add HTTP client abstraction to net module #14

Add HTTP client abstraction to net module

Add HTTP client abstraction to net module #14

Workflow file for this run

name: Net Strict CI
on:
push:
branches: [main, master, dev]
paths:
- ".github/workflows/net-strict-ci.yml"
- "CMakeLists.txt"
- "cmake/**"
- "include/**"
- "src/**"
- "tests/**"
- "README.md"
- "LICENSE"
- "CHANGELOG.md"
- "vix.json"
pull_request:
branches: [main, master, dev]
paths:
- ".github/workflows/net-strict-ci.yml"
- "CMakeLists.txt"
- "cmake/**"
- "include/**"
- "src/**"
- "tests/**"
- "README.md"
- "LICENSE"
- "CHANGELOG.md"
- "vix.json"
workflow_dispatch:
permissions:
contents: read
env:
DEPS: >
build-essential
cmake
ninja-build
clang
llvm
lld
g++
cppcheck
clang-tidy
valgrind
pkg-config
git
BUILD_JOBS: 2
jobs:
build-test:
name: Build and Tests (${{ matrix.compiler }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [clang, gcc]
steps:
- name: Checkout net repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y $DEPS
- name: Select compiler
run: |
if [ "${{ matrix.compiler }}" = "clang" ]; then
echo "CC=clang" >> "$GITHUB_ENV"
echo "CXX=clang++" >> "$GITHUB_ENV"
else
echo "CC=gcc" >> "$GITHUB_ENV"
echo "CXX=g++" >> "$GITHUB_ENV"
fi
- name: Configure
run: |
cmake -G Ninja -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DVIX_NET_BUILD_TESTS=ON
- name: Build
run: |
cmake --build build -j"${BUILD_JOBS}"
- name: Run tests
run: |
cd build
ctest --output-on-failure || true
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y $DEPS
- name: Configure
run: |
cmake -G Ninja -S . -B build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Run clang-tidy
run: |
set +e
find src tests -name '*.cpp' -print0 | xargs -0 -r -n1 -P2 clang-tidy -p build
exit 0
- name: Run cppcheck
run: |
cppcheck --enable=all --std=c++20 --quiet include/ src/ tests/ || true
valgrind:
name: Valgrind
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y $DEPS
- name: Configure
run: |
cmake -G Ninja -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DVIX_NET_BUILD_TESTS=ON
- name: Build
run: |
cmake --build build -j"${BUILD_JOBS}"
- name: Run valgrind
run: |
set +e
for exe in $(find build -type f -executable); do
timeout 10s valgrind "$exe" || true
done
standalone-package-check:
name: Standalone Package Export Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y $DEPS
- name: Configure installable standalone build
run: |
cmake -G Ninja -S . -B build-install \
-DCMAKE_BUILD_TYPE=Release \
-DVIX_NET_BUILD_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX="${PWD}/.ci-install"
- name: Build standalone package
run: |
cmake --build build-install -j"${BUILD_JOBS}"
- name: Install standalone package
run: |
cmake --install build-install
- name: Verify installed package files
run: |
echo "---- install tree ----"
find .ci-install -type f | sort
test -f .ci-install/include/vix/net/NetworkProbe.hpp || (echo "::error::header missing"; exit 1)
if [ -f .ci-install/lib/libvix_net.a ]; then
echo "STATIC lib OK"
else
echo "::error::libvix_net.a missing"
exit 1
fi
config-coverage:
name: Configuration Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y $DEPS
- name: Configure release
run: |
cmake -S . -B build-release \
-DCMAKE_BUILD_TYPE=Release
- name: Build release
run: |
cmake --build build-release
- name: Configure debug
run: |
cmake -S . -B build-debug \
-DCMAKE_BUILD_TYPE=Debug
- name: Build debug
run: |
cmake --build build-debug
summary:
name: Net CI Summary
runs-on: ubuntu-latest
needs:
[
build-test,
static-analysis,
valgrind,
standalone-package-check,
config-coverage,
]
steps:
- run: |
echo "Net CI OK"