/
githubmirror
/
pkgconf
Обзор
Документация
Войти
/
githubmirror
/
pkgconf
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
.github/workflows/test.yml
657 строк
18 KB
Ariadne Conill
ci: disable haiku for now
23 июл 2026, 03:56
23 июл 2026, 03:56
3657440
Код
Авторство
О чём код?
name: test on: push: pull_request: jobs: msvc: name: ${{ matrix.name }} strategy: fail-fast: false matrix: include: - name: win32-x86 runs_on: windows-2025 msbuild_arch: x86 - name: win64-x64 runs_on: windows-2025 msbuild_arch: x64 - name: win-arm64 runs_on: windows-11-arm msbuild_arch: arm64 runs-on: ${{ matrix.runs_on }} steps: - name: Checkout code uses: actions/checkout@v6 - name: Set up MSBuild uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ matrix.msbuild_arch }} - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.x" - name: Install Meson and Ninja shell: pwsh run: | python -m pip install --upgrade pip python -m pip install meson ninja - name: Install WiX run: | dotnet tool install --global wix $wixVersion = (wix --version).Trim() wix eula accept wix7 wix extension add -g "WixToolset.UI.wixext/$wixVersion" - name: Build run: | meson setup _build --vsenv -Dwerror=true meson compile -C _build msi - name: Run tests run: | meson test -v -C _build - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: build-output-${{ matrix.msbuild_arch }} path: | _build/*.exe _build/*.dll _build/*.msi clang-cl: name: ${{ matrix.name }} runs-on: windows-2025 steps: - name: Checkout code uses: actions/checkout@v6 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.x" - name: Install Meson and Ninja shell: pwsh run: | python -m pip install --upgrade pip python -m pip install meson ninja - name: Build run: | meson setup _build --vsenv -Dwerror=true meson compile -C _build env: CC: clang-cl - name: Run tests run: | meson test -v -C _build msys2: runs-on: windows-latest strategy: fail-fast: false matrix: include: [{ msystem: MINGW64, arch: x86_64 }] steps: - name: Checkout code uses: actions/checkout@v6 - name: setup-msys2 uses: msys2/setup-msys2@v2 with: msystem: ${{ matrix.msystem }} update: true install: >- mingw-w64-${{ matrix.arch }}-meson mingw-w64-${{ matrix.arch }}-ninja mingw-w64-${{ matrix.arch }}-gcc - name: Build shell: msys2 {0} run: | # the code assumes msvc style printf atm export CFLAGS=-D__USE_MINGW_ANSI_STDIO=0 meson setup _build -Dwerror=true meson compile -C _build - name: Run tests shell: msys2 {0} run: | meson test -v -C _build macOS: runs-on: macos-latest steps: - name: Checkout code uses: actions/checkout@v6 - name: Update system and add dependencies run: | brew update brew install meson - name: Build run: | meson setup _build -Dwerror=true meson compile -C _build - name: Run tests run: | meson test -v -C _build cygwin: runs-on: windows-latest steps: - name: Checkout code uses: actions/checkout@v6 - name: Setup Cygwin uses: cygwin/cygwin-install-action@v6 with: packages: | meson ninja gcc-core - name: Build shell: D:\cygwin\bin\bash.exe -o igncr '{0}' run: | export PATH="/usr/bin:$(cygpath ${SYSTEMROOT})/system32" meson setup _build -Dwerror=true meson compile -C _build - name: Run tests shell: D:\cygwin\bin\bash.exe -o igncr '{0}' run: | export PATH="/usr/bin:$(cygpath ${SYSTEMROOT})/system32" meson test -v -C _build QEMU_VMs: runs-on: ubuntu-latest defaults: run: shell: cpa.sh {0} strategy: fail-fast: false matrix: include: - os_image: netbsd version: "10.1" - os_image: freebsd version: "15.1" - os_image: openbsd version: "7.9" # - os_image: haiku # version: "r1beta5" - os_image: omnios version: "r151056" steps: - name: Checkout code uses: actions/checkout@v6 - name: Start VM on ${{ matrix.os_image }} uses: cross-platform-actions/action@v1.3.0 with: operating_system: ${{ matrix.os_image }} version: ${{ matrix.version }} - name: Install meson run: | case "${{ matrix.os_image }}" in netbsd) sudo pkgin -y install meson ;; freebsd) # Using system compiler sudo pkg -o ASSUME_ALWAYS_YES=yes install meson ;; openbsd) sudo pkg_add https://cdn.openbsd.org/%m/meson ;; haiku) pkgman install -y meson ;; omnios) sudo pkg install --deny-new-be --no-backup-be \ pkg:/developer/gcc14 \ pkg:/library/python-3/meson-313 \ pkg:/ooce/developer/ninja ;; esac - name: Build run: | if [[ "${{ matrix.os_image }}" == "omnios" ]]; then export PATH=/usr/lib/python3.13/bin:$PATH fi meson setup _build -Dwerror=true meson compile -C _build - name: Run tests run: | if [[ "${{ matrix.os_image }}" == "omnios" ]]; then export PATH=/usr/lib/python3.13/bin:$PATH fi meson test -v -C _build debian-meson: runs-on: ubuntu-latest container: image: debian:testing steps: - name: Checkout uses: actions/checkout@v6 - name: Update system and add dependencies run: | apt-get update apt-get install -y build-essential meson - name: Build run: | meson setup _build -Dwerror=true meson compile -C _build - name: Run tests run: | meson test -v -C _build debian-meson-asan: runs-on: ubuntu-latest container: image: debian:testing steps: - name: Checkout uses: actions/checkout@v6 - name: Update system and add dependencies run: | apt-get update apt-get install -y build-essential meson - name: Build run: | meson setup _build -Db_sanitize=address -Dwerror=true meson compile -C _build - name: Run tests run: | meson test -v -C _build env: ASAN_OPTIONS: "exitcode=7" dist-meson: runs-on: ubuntu-latest container: image: debian:testing steps: - name: Install git (required by actions/checkout and meson dist) run: | apt-get update apt-get install -y git # Container-mounted checkouts are owned by a different uid than # the one git operates as here, which trips git's dubious- # ownership check (CVE-2022-24765 mitigation) and breaks both # actions/checkout and meson dist's internal git invocations. git config --global --add safe.directory "*" - name: Checkout uses: actions/checkout@v6 - name: Update system and add dependencies run: | apt-get install -y build-essential meson - name: Build dist tarball run: | meson setup _build -Dwerror=true meson dist -C _build - name: Build and test tarball with Meson run: | tar xf _build/meson-dist/pkgconf-*.tar.xz cd pkgconf-*/ meson setup _build2 -Dwerror=true meson compile -C _build2 meson test -v -C _build2 alpine-meson: runs-on: ubuntu-latest container: image: alpine steps: - name: Checkout uses: actions/checkout@v6 - name: Update system and add dependencies run: | apk update apk add build-base meson gcovr bash git curl gpg - name: Build run: | meson setup _build -Dwerror=true -Db_coverage=true meson compile -C _build - name: Run tests run: | meson test -v -C _build - name: Run coverage run: | ninja -C _build coverage-xml - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v6 with: fail_ci_if_error: true files: ./_build/meson-logs/coverage.xml token: ${{ secrets.CODECOV_TOKEN }} alpine-muon: runs-on: ubuntu-latest container: image: alpine steps: - name: Checkout uses: actions/checkout@v6 - name: Update system and add dependencies run: | apk update apk add build-base muon samurai - name: Build run: | muon setup -Ddefault_library=both -Dwerror=true _build samu -C _build - name: Run tests run: | cd _build muon test -v -v debian-7: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v6 with: path: pkgconf - name: Checkout muon uses: actions/checkout@v6 with: repository: muon-build/muon path: muon - name: Build inside Debian 7 run: | cat > build.sh << 'EOF' #!/bin/bash set -e # See: https://www.howtoforge.com/using-old-debian-versions-in-your-sources.list cat > /etc/apt/sources.list << 'SOURCES' deb http://archive.debian.org/debian/ wheezy main non-free contrib deb-src http://archive.debian.org/debian/ wheezy main non-free contrib deb http://archive.debian.org/debian-security/ wheezy/updates main non-free contrib deb-src http://archive.debian.org/debian-security/ wheezy/updates main non-free contrib SOURCES # Install gcc apt-get update || true apt-get install -y --force-yes gcc # Build muon cd /home/muon ./bootstrap.sh build build/muon-bootstrap setup -Dmeson-docs=disabled build build/muon-bootstrap -C build samu build/muon -C build install # Build pkgconf + run tests cd /home/pkgconf export CFLAGS="${CFLAGS} -Wno-missing-field-initializers -Wno-missing-braces" muon build builddir muon -C builddir test -v -v EOF docker run --rm --volume "$PWD":/home debian:7 /bin/bash /home/build.sh analysis: runs-on: ubuntu-latest container: image: alpine steps: - name: Checkout uses: actions/checkout@v6 - name: Update system and add dependencies run: | apk update apk add build-base meson libtool xz gzip - name: Build run: | CC=gcc meson setup _build -Danalyzer=true -Dwerror=true meson compile -C _build llvm-sanitizers: runs-on: ubuntu-latest container: image: alpine steps: - name: Checkout uses: actions/checkout@v6 - name: Update system and add dependencies run: | apk update apk add build-base meson clang cmd:llvm-symbolizer compiler-rt - name: Build run: | CC=clang meson setup _build -Dwerror=true -Db_sanitize=address,undefined -Db_lundef=false meson compile -C _build - name: Run tests run: | meson test -v -C _build lite: runs-on: ubuntu-latest container: image: alpine steps: - name: Checkout uses: actions/checkout@v6 - name: Update system and add dependencies run: | apk update apk add build-base clang cmd:llvm-symbolizer compiler-rt - name: Build run: | export CC=clang export CFLAGS="-std=c99 -O2 -Wall -Wextra -ggdb3 -fsanitize=address,undefined" make -f Makefile.lite PKG_DEFAULT_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig" SYSTEM_LIBDIR="/usr/lib" SYSTEM_INCLUDEDIR="/usr/include" -j $(nproc) - name: Run tests run: | export CC=clang export CFLAGS="-std=c99 -O2 -Wall -Wextra -ggdb3 -fsanitize=address,undefined" make -f Makefile.lite PKG_DEFAULT_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig" SYSTEM_LIBDIR="/usr/lib" SYSTEM_INCLUDEDIR="/usr/include" -j $(nproc) check cmake-macros: name: cmake-macros (${{ matrix.name }}) strategy: fail-fast: false matrix: include: - name: linux-static runs_on: ubuntu-latest default_library: static - name: linux-shared runs_on: ubuntu-latest default_library: shared - name: macos-static runs_on: macos-latest default_library: static runs-on: ${{ matrix.runs_on }} steps: - name: Checkout code uses: actions/checkout@v6 - name: Install build tools (Linux) if: runner.os == 'Linux' run: | sudo apt-get update sudo apt-get install -y build-essential meson ninja-build cmake - name: Install build tools (macOS) if: runner.os == 'macOS' run: | brew install meson ninja cmake - name: Build and install pkgconf run: | # Point with-system-libdir at a path that can't match the install # prefix, so pkgconf keeps -L for its own libdir in --libs-only-L # output. It otherwise drops -L when a module's libdir equals the # compiled-in "system" libdir, which defaults to the install prefix's # libdir. meson setup _build_cmake_verify \ --prefix="${{ github.workspace }}/_install_cmake_verify" \ -Ddefault_library=${{ matrix.default_library }} \ -Dwith-system-libdir=/nonexistent-pkgconf-cmake-test-marker meson compile -C _build_cmake_verify meson install -C _build_cmake_verify - name: Configure environment for the installed (possibly shared) library run: | prefix="${{ github.workspace }}/_install_cmake_verify" # meson may install under lib/, lib64/ or a multiarch dir such as # lib/x86_64-linux-gnu, so locate the shared library by name instead # of guessing the directory. Empty on the static legs, which don't # need it. libdirs="$(find "$prefix" -type f \( -name 'libpkgconf*.so*' -o -name 'libpkgconf*.dylib' \) -exec dirname {} \; | sort -u | tr '\n' ':')" echo "LD_LIBRARY_PATH=${libdirs}${LD_LIBRARY_PATH}" >> "$GITHUB_ENV" echo "DYLD_LIBRARY_PATH=${libdirs}${DYLD_LIBRARY_PATH}" >> "$GITHUB_ENV" echo "CMAKE_PREFIX_PATH=${prefix}" >> "$GITHUB_ENV" - name: Install a real pkg-config package (zlib) run: | if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get install -y zlib1g-dev else brew install zlib fi # The pkgconf we built has its own compiled-in search path under the # test prefix, so tell it where the OS actually dropped zlib.pc. zlibpc="$(find /usr /opt/homebrew /usr/local -name zlib.pc 2>/dev/null | head -n1)" if [ -z "$zlibpc" ]; then echo "could not locate an installed zlib.pc" >&2 exit 1 fi echo "PKG_CONFIG_PATH=$(dirname "$zlibpc"):${PKG_CONFIG_PATH}" >> "$GITHUB_ENV" - name: pkgconf_check_modules() / pkgconf_search_module() / query macros run: | cmake -S cmake/tests/basic -B _build_cmake_test cmake --build _build_cmake_test _build_cmake_test/consumer - name: REQUIRED module must fail configure when not found run: | if cmake -S cmake/tests/required-fail -B _build_cmake_required_fail; then echo "expected cmake configure to fail for a REQUIRED module that does not exist" >&2 exit 1 fi - name: Consume a real package (zlib) through the imported target run: | cmake -S cmake/tests/zlib -B _build_cmake_zlib cmake --build _build_cmake_zlib _build_cmake_zlib/zlib-consumer - name: Generate pkg-config files for CMake targets run: | cmake -S cmake/tests/generate -B _build_cmake_generate - name: Reject generated pc file without a version run: | if cmake -S cmake/tests/generate-fail -B _build_cmake_generate_fail; then echo "pkgconf_generate_pc() accepted a target without a version" >&2 exit 1 fi fuzz: runs-on: ubuntu-latest container: image: alpine strategy: fail-fast: false matrix: include: - fuzzer: parser corpus: _fuzz/corpus seed: tests/lib1 - fuzzer: solver corpus: _fuzz/solver-corpus seed: fuzzer/solver-corpus - fuzzer: spdxtool corpus: _fuzz/spdxtool-corpus seed: fuzzer/solver-corpus steps: - name: Checkout code uses: actions/checkout@v6 - name: Update system and add dependencies run: | apk update apk add build-base meson clang cmd:llvm-symbolizer compiler-rt - name: Build run: | CC=clang meson setup _fuzz -Dfuzzing=true -Ddefault_library=static -Db_sanitize=address,undefined -Db_lundef=false meson compile -C _fuzz - name: Run ${{ matrix.fuzzer }} fuzzer run: | mkdir -p ${{ matrix.corpus }} ./_fuzz/fuzzer/${{ matrix.fuzzer }}-fuzzer -max_total_time=120 -max_len=8192 -rss_limit_mb=2048 -print_final_stats=1 ${{ matrix.corpus }} ${{ matrix.seed }} env: ASAN_OPTIONS: "abort_on_error=1:halt_on_error=1:detect_leaks=0" UBSAN_OPTIONS: "halt_on_error=1:print_stacktrace=1" - name: Upload crash artifacts if: failure() uses: actions/upload-artifact@v4 with: name: fuzz-crashes-${{ matrix.fuzzer }} path: | crash-* oom-* timeout-* if-no-files-found: ignore