Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,55 @@ jobs:
path: ./cobertura.xml
retention-days: 7

linux-valgrind:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Install valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind ninja-build
- name: Build
run: |
cmake -G "Ninja" -B build -DCMAKE_BUILD_TYPE=Debug -DTCS_ENABLE_TESTS=ON -DTCS_WARNINGS_AS_ERRORS=ON
cmake --build build
- name: Run tests under valgrind
run: |
set -e -o pipefail
sudo ip link set lo multicast on
status=0

run_under_valgrind() {
local binary="$1"

echo "### ${binary}" >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
set +e
sudo capsh --caps='cap_net_raw+eip' -- -c \
"valgrind \
--leak-check=full \
--show-leak-kinds=all \
--errors-for-leak-kinds=all \
--track-origins=yes \
--track-fds=yes \
--error-exitcode=1 \
${binary}" \
2>&1 | tee -a "$GITHUB_STEP_SUMMARY"
local test_status=${PIPESTATUS[0]}
set -e
echo '```' >> "$GITHUB_STEP_SUMMARY"

if [ "$test_status" -ne 0 ]; then
status="$test_status"
fi
return 0
}

run_under_valgrind ./build/tests/tests
run_under_valgrind ./build/tests/tests_header_only
exit "$status"

# ---- BUILDS ----

msvc-build:
Expand Down
2 changes: 1 addition & 1 deletion include/tinycsocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#ifndef TINYCSOCKET_INTERNAL_H_
#define TINYCSOCKET_INTERNAL_H_

static const char* const TCS_VERSION_TXT = "v0.3.79";
static const char* const TCS_VERSION_TXT = "v0.3.80";
extern const char* const TCS_LICENSE_TXT;

/*
Expand Down
2 changes: 1 addition & 1 deletion src/tinycsocket_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef TINYCSOCKET_INTERNAL_H_
#define TINYCSOCKET_INTERNAL_H_

static const char* const TCS_VERSION_TXT = "v0.3.79";
static const char* const TCS_VERSION_TXT = "v0.3.80";
extern const char* const TCS_LICENSE_TXT;

/*
Expand Down
Loading