Skip to content

vcpkg fix

vcpkg fix #38

Workflow file for this run

name: CI
on:
push:
branches: [ master, main, develop ]
pull_request:
branches: [ master, main, develop ]
jobs:
# Linux build with multiple compilers
linux:
name: Linux (${{ matrix.compiler }}, ${{ matrix.config }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
config: [full, minimal]
include:
- compiler: gcc
cc: gcc
cxx: g++
- compiler: clang
cc: clang
cxx: clang++
steps:
- uses: actions/checkout@v4
- name: Install dependencies (full)
if: matrix.config == 'full'
run: |
sudo apt-get update
sudo apt-get install -y \
zlib1g-dev \
libbz2-dev \
liblzma-dev \
libzstd-dev \
libarchive-dev \
valgrind
- name: Install dependencies (minimal)
if: matrix.config == 'minimal'
run: |
sudo apt-get update
sudo apt-get install -y valgrind
- name: Configure
run: |
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER=${{ matrix.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DCMAKE_BUILD_TYPE=Debug
- name: Build
run: cmake --build build --parallel $(nproc)
- name: Test
run: |
cd build
./tests/test_basic
./tests/test_compression || true
./tests/test_walker || true
./tests/test_archive || true
- name: Memory leak check (valgrind)
if: matrix.config == 'full'
run: |
cd build
valgrind --leak-check=full --error-exitcode=1 ./tests/test_basic
valgrind --leak-check=full --error-exitcode=1 ./tests/test_compression || true
valgrind --leak-check=full --error-exitcode=1 ./tests/test_walker || true
# macOS build
macos:
name: macOS (${{ matrix.config }})
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
config: [full, minimal]
steps:
- uses: actions/checkout@v4
- name: Install dependencies (full)
if: matrix.config == 'full'
run: |
brew install zlib bzip2 xz zstd libarchive
- name: Configure
run: |
mkdir build
cd build
if [ "${{ matrix.config }}" = "full" ]; then
cmake .. -DCMAKE_BUILD_TYPE=Debug \
-DZLIB_ROOT=$(brew --prefix zlib) \
-DBZIP2_ROOT=$(brew --prefix bzip2) \
-DLibLZMA_ROOT=$(brew --prefix xz) \
-Dzstd_ROOT=$(brew --prefix zstd) \
-DLibArchive_ROOT=$(brew --prefix libarchive)
else
cmake .. -DCMAKE_BUILD_TYPE=Debug
fi
- name: Build
run: cmake --build build --parallel $(sysctl -n hw.ncpu)
- name: Test
run: |
cd build
./tests/test_basic
./tests/test_compression || true
./tests/test_walker || true
./tests/test_archive || true
# Windows build
windows:
name: Windows (${{ matrix.config }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
config: [full, minimal]
steps:
- uses: actions/checkout@v4
- name: Cache vcpkg packages
if: matrix.config == 'full'
uses: actions/cache@v4
with:
path: |
${{ env.VCPKG_INSTALLATION_ROOT }}\installed
${{ env.VCPKG_INSTALLATION_ROOT }}\packages
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json') }}-${{ hashFiles('.github/workflows/ci.yml') }}
restore-keys: |
vcpkg-${{ runner.os }}-
- name: Install dependencies (full)
if: matrix.config == 'full'
run: |
vcpkg install zlib bzip2 liblzma zstd libarchive --triplet x64-windows
- name: Configure (full)
if: matrix.config == 'full'
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows
- name: Configure (minimal)
if: matrix.config == 'minimal'
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug `
-DENABLE_ZLIB=OFF `
-DENABLE_BZIP2=OFF `
-DENABLE_LZMA=OFF `
-DENABLE_ZSTD=OFF `
-DENABLE_LIBARCHIVE=OFF
- name: Build
run: cmake --build build --config Debug --parallel
- name: Test
run: |
cd build\tests\Debug
.\test_basic.exe
if (Test-Path .\test_compression.exe) { .\test_compression.exe }
if (Test-Path .\test_walker.exe) { .\test_walker.exe }
if (Test-Path .\test_archive.exe) { .\test_archive.exe }
# Code coverage (Linux only)
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
zlib1g-dev \
libbz2-dev \
liblzma-dev \
libzstd-dev \
libarchive-dev \
lcov
- name: Configure with coverage
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="--coverage -fprofile-arcs -ftest-coverage" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage"
- name: Build
run: cmake --build build --parallel $(nproc)
- name: Run tests
run: |
cd build
./tests/test_basic
./tests/test_compression || true
./tests/test_walker || true
./tests/test_archive || true
- name: Generate coverage report
run: |
cd build
lcov --capture --directory . --output-file coverage.info || true
lcov --remove coverage.info '/usr/*' --output-file coverage.info || true
lcov --list coverage.info || true
# Static analysis
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
zlib1g-dev \
libbz2-dev \
liblzma-dev \
libzstd-dev \
libarchive-dev \
cppcheck
- name: Run cppcheck
run: |
cppcheck --enable=warning,performance,portability \
--std=c99 \
--error-exitcode=0 \
-I include \
src/ \
2>&1 | tee cppcheck-report.txt
- name: Configure
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Build with warnings
run: |
cmake --build build --parallel $(nproc) -- VERBOSE=1 2>&1 | \
tee build-warnings.txt
# Documentation check
documentation:
name: Documentation Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check README exists
run: |
test -f README.md
echo "README.md found"
- name: Check example files
run: |
test -f examples/walk_tree.c
test -f examples/large_file_mmap.c
test -f examples/test_mmap_emulation.c
echo "All example files found"
- name: Check headers documented
run: |
grep -q "QUICK START" include/stream.h
echo "Header documentation found"
# Build summary
build-summary:
name: Build Summary
runs-on: ubuntu-latest
needs: [linux, macos, windows, coverage, static-analysis, documentation]
if: always()
steps:
- name: Check results
run: |
echo "Linux builds: ${{ needs.linux.result }}"
echo "macOS builds: ${{ needs.macos.result }}"
echo "Windows builds: ${{ needs.windows.result }}"
echo "Coverage: ${{ needs.coverage.result }}"
echo "Static analysis: ${{ needs.static-analysis.result }}"
echo "Documentation: ${{ needs.documentation.result }}"