CI / lint (pull_request) Failing after 0s
CI / build-and-test (pull_request) Skipped
CI / sanitizers (address) (pull_request) Skipped
CI / sanitizers (undefined) (pull_request) Skipped
CI / fuzz-build (pull_request) Skipped
CI / coverage (pull_request) Skipped
CI / valgrind (pull_request) Skipped
- Replace --dist=loadgroup (a no-op: it only groups by xdist_group marks) with --dist=load, and make module teardowns remove only their own SOURCE_DIR/DEST_DIR (never the shared worker-keyed TEST_DATA_DIR) so interleaved modules can't wipe each other's fixtures. Add a session-scoped cleanup of the per-worker dir. (loadfile grouped the whole test_features.py module onto one worker and slowed the full suite to 761s vs 224s with load.) - Mark the two setpriv privilege tests with a 'setpriv' marker and run the full merge suite as -m "not setpriv", so the dev/main gate can't go red on the env-dependent /root-traversal tests regardless of the runner uid. - Add a TLS basic test to the ci subset, add workflow_dispatch for on-demand full runs, and fix trailing newlines. - Measured: smoke -m ci = 28 passed/39s; full -n4 = 280 passed/11 skipped/1 xpassed in 224s (was 860s serial).
138 lines
4.1 KiB
YAML
138 lines
4.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, dev]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
container: gitea.tap-tap.win/taptap/fastsync-ci:v10
|
|
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/
|
|
|
|
# Fast PR gate: build + unit tests + a representative subset of integration
|
|
# tests (marked `ci`), parallelized with pytest-xdist. Only the full coverage
|
|
# jobs below (sanitizers/fuzz/coverage/valgrind and the FULL integration
|
|
# suite) run on merge to dev/main, so PR CI stays well under ~3 minutes.
|
|
build-and-test:
|
|
runs-on: ubuntu-latest
|
|
container: gitea.tap-tap.win/taptap/fastsync-ci:v10
|
|
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 (PR smoke subset)
|
|
if: github.event_name == 'pull_request'
|
|
run: python3 -m pytest tests/integration/ -n 4 --dist=load -m ci --durations=25 --tb=short -q
|
|
|
|
- name: Integration Tests (full suite)
|
|
if: github.event_name == 'push'
|
|
run: python3 -m pytest tests/integration/ -n 4 --dist=load -m "not setpriv" --durations=25 --tb=short -q
|
|
|
|
sanitizers:
|
|
runs-on: ubuntu-latest
|
|
container: gitea.tap-tap.win/taptap/fastsync-ci:v10
|
|
needs: lint
|
|
if: github.event_name == 'push'
|
|
strategy:
|
|
matrix:
|
|
sanitizer: [address, undefined]
|
|
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
|
|
|
|
fuzz-build:
|
|
runs-on: ubuntu-latest
|
|
container: gitea.tap-tap.win/taptap/fastsync-ci:v10
|
|
needs: lint
|
|
if: github.event_name == 'push'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Configure (clang + fuzz)
|
|
run: CC=clang CXX=clang++ cmake -B build-fuzz -S . -DENABLE_FUZZ=ON
|
|
|
|
- name: Build fuzz targets
|
|
run: cmake --build build-fuzz -j$(nproc)
|
|
|
|
- name: Smoke fuzz targets
|
|
run: |
|
|
for target in build-fuzz/fuzz_*; do
|
|
[ -x "$target" ] || continue
|
|
timeout 10s "$target" -runs=100 -max_total_time=5
|
|
done
|
|
|
|
coverage:
|
|
runs-on: ubuntu-latest
|
|
container: gitea.tap-tap.win/taptap/fastsync-ci:v10
|
|
needs: lint
|
|
if: github.event_name == 'push'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Configure
|
|
run: cmake -B build -S . -DENABLE_COVERAGE=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 --ignore-errors negative
|
|
lcov --remove coverage.info '/usr/*' '*/tests/*' '*/_deps/*' --output-file coverage.info --branch-coverage --ignore-errors unused,negative
|
|
lcov --list coverage.info
|
|
|
|
valgrind:
|
|
runs-on: ubuntu-latest
|
|
container: gitea.tap-tap.win/taptap/fastsync-ci:v10
|
|
needs: lint
|
|
if: github.event_name == 'push'
|
|
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: Valgrind Memcheck
|
|
run: valgrind --leak-check=full --show-leak-kinds=definite --error-exitcode=1 ./build/tests
|
|
env:
|
|
FASTSYNC_UNDER_VALGRIND: "1"
|