Files
FastSync/.gitea/workflows/ci.yaml
T
TapTap 2243c958ce
CI / lint (push) Successful in 7s
CI / lint (pull_request) Successful in 7s
CI / build-and-test (push) Successful in 53s
CI / sanitizers (address) (push) Successful in 14s
CI / coverage (push) Failing after 24s
CI / valgrind (push) Failing after 26s
CI / build-and-test (pull_request) Successful in 53s
CI / sanitizers (address) (pull_request) Successful in 14s
CI / coverage (pull_request) Failing after 24s
CI / valgrind (pull_request) Failing after 25s
ci: install lcov and valgrind in CI jobs
The fastsync-ci:v7 container does not include lcov or valgrind.
Add apt-get install steps to the coverage and valgrind jobs.

Also update lcov flags for lcov 2.x compatibility:
--rc lcov_branch_coverage=1 -> --branch-coverage
2026-07-19 19:38:20 +02:00

104 lines
2.9 KiB
YAML

name: CI
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
container: gitea.tap-tap.win/taptap/fastsync-ci:v7
steps:
- name: Checkout
uses: actions/checkout@v4
- name: clang-format check
run: find src/ tests/ -name '*.c' -o -name '*.h' | xargs clang-format --dry-run --Werror
- name: cppcheck
run: cppcheck --enable=warning,style,performance,portability --suppress=missingIncludeSystem --error-exitcode=1 --inline-suppr src/ tests/
build-and-test:
runs-on: ubuntu-latest
container: gitea.tap-tap.win/taptap/fastsync-ci:v7
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: cmake -B build -S . -DSTRICT_WARNINGS=ON
- name: Build
run: cmake --build build -j$(nproc)
- name: Unit Tests
run: ctest --test-dir build --output-on-failure -j$(nproc)
- name: Integration Tests
run: python3 -m pytest tests/integration/ -v --tb=short
sanitizers:
runs-on: ubuntu-latest
container: gitea.tap-tap.win/taptap/fastsync-ci:v7
needs: lint
strategy:
matrix:
sanitizer: [address]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: cmake -B build-${{ matrix.sanitizer }} -S . -DSANITIZER=${{ matrix.sanitizer }}
- name: Build
run: cmake --build build-${{ matrix.sanitizer }} -j$(nproc)
- name: Unit Tests
run: ctest --test-dir build-${{ matrix.sanitizer }} --output-on-failure
coverage:
runs-on: ubuntu-latest
container: gitea.tap-tap.win/taptap/fastsync-ci:v7
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install lcov
run: apt-get update -qq && apt-get install -y -qq lcov
- name: Configure
run: cmake -B build -S . -DENABLE_COVERAGE=ON -DSTRICT_WARNINGS=ON
- name: Build
run: cmake --build build -j$(nproc)
- name: Unit Tests
run: ctest --test-dir build --output-on-failure
- name: Coverage Report
run: |
lcov --capture --directory build --output-file coverage.info --branch-coverage
lcov --remove coverage.info '/usr/*' '*/tests/*' '*/xxhash/*' --output-file coverage.info --branch-coverage
lcov --list coverage.info
valgrind:
runs-on: ubuntu-latest
container: gitea.tap-tap.win/taptap/fastsync-ci:v7
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install valgrind
run: apt-get update -qq && apt-get install -y -qq valgrind
- name: Configure
run: cmake -B build -S . -DSTRICT_WARNINGS=ON
- name: Build
run: cmake --build build -j$(nproc)
- name: Valgrind Memcheck
run: valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1 ./build/tests