Skip to content

fix: Allow use of negative integers in metas #457

fix: Allow use of negative integers in metas

fix: Allow use of negative integers in metas #457

Workflow file for this run

name: Pipeline
on:
push:
branches:
- master
- hotfix/*
tags:
- v*
pull_request:
workflow_dispatch:
inputs:
force_release:
description: "Force run also release step"
default: false
type: boolean
jobs:
tests:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.13"]
config: [Release]
include:
- runs-on: windows-latest
platform: windows
- runs-on: ubuntu-latest
platform: linux
- runs-on: macos-latest
platform: macos
- runs-on: windows-latest
platform: windows
python-version: "3.13"
config: Debug
- runs-on: windows-latest
platform: windows
python-version: "3.12"
config: Release
- runs-on: windows-latest
platform: windows
python-version: "3.11"
config: Release
- runs-on: windows-latest
platform: windows
python-version: "3.10"
config: Release
- runs-on: windows-latest
platform: windows
python-version: "3.9"
config: Release
name: |
Tests - Python ${{ matrix.python-version }} (${{ matrix.platform }})${{ matrix.config == 'Debug' && ' (Debug)' || '' }}
runs-on: ${{ matrix.runs-on }}
steps:
- name: Setup Git
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build
env:
YARAMOD_BUILD_CONFIGURATION: ${{ matrix.config || 'Release' }}
YARAMOD_BUILD_WITH_UNIT_TESTS: 1
run: |
python -m pip install .
- name: Upload build directory
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.platform }}-py${{ matrix.python-version }}-${{ matrix.config || 'Release' }}-${{ strategy.job-index }}
path: build/
- name: C++ Tests
run: |
${{ matrix.platform == 'windows' && format('build\tests\cpp\{0}\yaramod_tests.exe', matrix.config) || 'build/tests/cpp/yaramod_tests' }}
- name: Python Tests
run: |
python -m pip install pytest mypy==0.991
pytest -v tests/python
- name: Documentation
if: ${{ matrix.platform == 'linux' }}
run: |
cd docs/rtd
pip install -r requirements.txt
make clean && make html SPHINXOPTS="-W --keep-going -n"
asan:
name: |
Tests (Address Sanitizer)
runs-on: ubuntu-latest
steps:
- name: Setup Git
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout sources
uses: actions/checkout@v4
- name: Build
run: |
mkdir -p build
cd build
cmake -DYARAMOD_TESTS=ON -DYARAMOD_ASAN=ON ..
cmake --build . -- -j
# Disable ASLR for this, see https://stackoverflow.com/questions/77894856/possible-bug-in-gcc-sanitizers
- name: Tests
run: |
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
./build/tests/cpp/yaramod_tests
build_sdist:
needs:
- tests
- asan
name: |
Build Python sdist
runs-on: ubuntu-latest
steps:
- name: Setup Git
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Build sdist
run: |
pip install -U setuptools
python setup.py sdist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: python-sdist
path: |
./dist/*.tar.gz
if-no-files-found: error
retention-days: 7
build_wheel:
needs:
- tests
- asan
strategy:
fail-fast: false
matrix:
include:
- runs-on: ubuntu-latest
platform: linux
arch: manylinux_x86_64
- runs-on: windows-latest
platform: windows
arch: win_amd64
- runs-on: macos-latest
platform: macos
arch: macosx_arm64
name: |
Build Python wheel (${{ matrix.arch }})
runs-on: ${{ matrix.runs-on }}
steps:
- name: Setup Git
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==3.1.4
- name: Build wheels
env:
CIBW_PLATFORM: ${{ matrix.platform }}
CIBW_BUILD: "cp3*-${{ matrix.arch }}"
CIBW_SKIP: "cp3??t-* cp38*"
run: |
python -m cibuildwheel --output-dir wheelhouse
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: python-wheel-${{ matrix.platform }}-${{ matrix.arch }}-${{ strategy.job-index }}
path: |
./wheelhouse/*.whl
if-no-files-found: error
retention-days: 7
release:
if: ${{ startsWith(github.ref, 'refs/tags/v') || inputs.force_release }}
name: |
Release
needs:
- build_sdist
- build_wheel
runs-on: ubuntu-latest
steps:
- name: Downloads wheels
uses: actions/download-artifact@v4
with:
pattern: python-*
path: package
merge-multiple: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install twine
run: |
python -m pip install -U twine packaging setuptools
- name: Upload to PyPI
run: |
twine upload --skip-existing -u __token__ -p ${{ secrets.pypi_token }} ./package/*.{whl,tar.gz}