CI #2798
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| schedule: | |
| # run CI every day even if no PRs/merges occur | |
| - cron: '0 12 * * *' | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: deps | |
| run: | | |
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc | |
| sudo add-apt-repository -y "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main" | |
| sudo apt-get update | |
| sudo apt-get install -y clang-format-18 libicu-dev | |
| - name: lint | |
| run: | | |
| mkdir build && cd build | |
| cmake -DPEPARSE_WARNINGS_AS_ERRORS=ON .. | |
| cmake --build . --target peparse_format | |
| cd .. && git diff --exit-code | |
| pe-parse: | |
| strategy: | |
| matrix: | |
| platform: ["ubuntu-latest", "macos-latest"] | |
| build-type: ["Debug", "Release"] | |
| build-shared: ["0", "1"] | |
| compiler: | |
| - { CC: "clang", CXX: "clang++" } | |
| - { CC: "gcc", CXX: "g++" } | |
| exclude: | |
| - platform: macos-latest | |
| compiler: { CC: "gcc", CXX: "g++" } | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| submodules: 'true' | |
| - name: Install ICU (Ubuntu) | |
| if: matrix.platform == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libicu-dev | |
| - name: Install ICU (macOS) | |
| if: matrix.platform == 'macos-latest' | |
| run: | | |
| brew install icu4c | |
| - name: Set ICU_ROOT for macOS | |
| if: matrix.platform == 'macos-latest' | |
| run: | | |
| echo "ICU_ROOT=$(brew --prefix icu4c)" >> "$GITHUB_ENV" | |
| - name: Enable ASan+UBSan Sanitizers | |
| if: matrix.build-type == 'Debug' | |
| run: | | |
| echo "SANITIZER_FLAG=-DPEPARSE_USE_SANITIZER=Address,Undefined" >> "$GITHUB_ENV" | |
| - name: build | |
| env: | |
| CC: ${{ matrix.compiler.CC }} | |
| CXX: ${{ matrix.compiler.CXX }} | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake_args=( | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} | |
| -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} | |
| -DPEPARSE_ENABLE_TESTING=ON | |
| -DPEPARSE_ENABLE_EXAMPLES=ON | |
| -DPEPARSE_WARNINGS_AS_ERRORS=ON | |
| ) | |
| if [ -n "${SANITIZER_FLAG:-}" ]; then | |
| cmake_args+=("${SANITIZER_FLAG}") | |
| fi | |
| cmake "${cmake_args[@]}" .. | |
| cmake --build . | |
| - name: test | |
| env: | |
| CTEST_OUTPUT_ON_FAILURE: 1 | |
| run: | | |
| cd build && ctest -V | |
| ./dump-pe/dump-pe ../tests/assets/example.exe | |
| pepy: | |
| strategy: | |
| matrix: | |
| platform: ["ubuntu-latest", "macos-latest"] | |
| python: | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| - "3.14" | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Install ICU (Ubuntu) | |
| if: matrix.platform == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libicu-dev | |
| - name: Install ICU (macOS) | |
| if: matrix.platform == 'macos-latest' | |
| run: | | |
| brew install icu4c | |
| echo "ICU_ROOT=$(brew --prefix icu4c)" >> "$GITHUB_ENV" | |
| - name: build | |
| run: | | |
| python -m pip install build wheel setuptools | |
| python -m build | |
| - name: test distributions | |
| run: | | |
| for dist in dist/*; do | |
| python -m venv test-env | |
| ./test-env/bin/python -m pip install "${dist}" | |
| ./test-env/bin/python tests/test_pepy.py tests/assets/example.exe | |
| rm -rf test-env | |
| done | |
| pe-parse-windows: | |
| strategy: | |
| matrix: | |
| build-arch: ["x64", "Win32"] | |
| build-type: ["Debug", "Release"] | |
| build-shared: ["0", "1"] | |
| runs-on: windows-2025-vs2026 | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| submodules: 'true' | |
| - name: Enable ASan Sanitizers | |
| if: matrix.build-type == 'Debug' && matrix.build-arch == 'x64' | |
| run: | | |
| echo "SANITIZER_FLAG=-DPEPARSE_USE_SANITIZER=Address" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | |
| - name: build | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake ` | |
| -G "Visual Studio 18 2026" ` | |
| -A ${{ matrix.build-arch }} ` | |
| -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} ` | |
| -DPEPARSE_ENABLE_TESTING=ON ` | |
| -DPEPARSE_ENABLE_EXAMPLES=ON ` | |
| -DPEPARSE_WARNINGS_AS_ERRORS=ON ` | |
| $Env:SANITIZER_FLAG ` | |
| .. | |
| cmake --build . --config ${{ matrix.build-type }} | |
| - name: install | |
| run: | | |
| cd build | |
| cmake --build . --config ${{ matrix.build-type }} --target install | |
| # ctest launches /fsanitize=address binaries that depend on | |
| # clang_rt.asan_dynamic-x86_64.dll, which only sits on PATH inside a VS | |
| # developer prompt. Source vcvars so ctest can find it; otherwise the | |
| # tests fail to launch with STATUS_DLL_NOT_FOUND (0xc0000135). | |
| - name: test | |
| shell: cmd # zizmor: ignore[misfeature] vcvarsall.bat must run under cmd to expose the ASan runtime on PATH. | |
| env: | |
| CTEST_OUTPUT_ON_FAILURE: 1 | |
| run: | | |
| "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -version "[18.0,19.0)" -property installationPath > "%RUNNER_TEMP%\vsinstall.txt" || exit /b 1 | |
| set /p VSINSTALL=<"%RUNNER_TEMP%\vsinstall.txt" | |
| call "%VSINSTALL%\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.build-arch == 'Win32' && 'x86' || 'x64' }} || exit /b 1 | |
| cd build || exit /b 1 | |
| ctest -V || exit /b 1 | |
| .\bin\dump-pe.exe ..\tests\assets\example.exe | |
| pepy-windows: | |
| strategy: | |
| matrix: | |
| python: | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| - "3.14" | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: build | |
| run: | | |
| python -m pip install --upgrade build wheel setuptools | |
| python -m build | |
| - name: install | |
| run: | | |
| python -m pip install --user . | |
| - name: test | |
| run: | | |
| python tests/test_pepy.py tests/assets/example.exe |