verona-rt #46
Workflow file for this run
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: PR Gate | |
| on: | |
| pull_request: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| jobs: | |
| linting: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Use Python 3.14 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.14 | |
| - name: Install flake8 | |
| run: pip install -e .[linting] | |
| - name: Run flake8 | |
| run: flake8 src/bocpy test | |
| cpp-format: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| path: | |
| - check: src/bocpy | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Run clang-format style check | |
| uses: jidicula/clang-format-action@v4.18.0 | |
| with: | |
| clang-format-version: '18' | |
| check-path: ${{matrix.path['check']}} | |
| exclude-regex: ${{matrix.path['exclude']}} | |
| linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Use Python ${{matrix.python_version}} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{matrix.python_version}} | |
| - name: Get dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| - name: Python build | |
| run: pip install -e .[test] --verbose | |
| - name: Python test | |
| run: pytest -vv -s | |
| windows: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Use Python ${{matrix.python_version}} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{matrix.python_version}} | |
| - name: Get dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| - name: Python build | |
| run: pip install -e .[test] --verbose | |
| - name: Python test | |
| run: pytest -vv -s | |
| macos-arm64: | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Use Python ${{matrix.python_version}} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{matrix.python_version}} | |
| - name: Get dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| - name: Python build | |
| run: pip install -e .[test] --verbose | |
| - name: Python test | |
| run: pytest -vv -s | |
| macos-x86_64: | |
| runs-on: macos-15-intel | |
| strategy: | |
| matrix: | |
| python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Use Python ${{matrix.python_version}} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{matrix.python_version}} | |
| - name: Get dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| - name: Python build | |
| run: pip install -e .[test] --verbose | |
| - name: Python test | |
| run: pytest -vv -s | |
| free-threaded: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python_version: ["3.13t", "3.14t"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Use Python ${{matrix.python_version}} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{matrix.python_version}} | |
| - name: Get dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| - name: Python build | |
| run: pip install -e .[test] --verbose | |
| - name: Verify GIL is disabled | |
| run: python -c "import sys; assert not sys._is_gil_enabled(), 'GIL should be disabled'" | |
| - name: Verify import does not re-enable GIL | |
| run: python -c "import bocpy; import sys; assert not sys._is_gil_enabled(), 'GIL re-enabled on import'" | |
| - name: Python test | |
| uses: nick-fields/retry@v4 | |
| with: | |
| max_attempts: 3 | |
| timeout_minutes: 10 | |
| command: pytest -vv -s | |
| asan: | |
| runs-on: ubuntu-latest | |
| env: | |
| CPYTHON_VERSION: v3.14.2 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang llvm build-essential pkg-config \ | |
| libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \ | |
| libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \ | |
| lzma lzma-dev tk-dev uuid-dev zlib1g-dev libzstd-dev | |
| - name: Download CPython ${{ env.CPYTHON_VERSION }} | |
| run: | | |
| git clone --depth 1 --branch ${{ env.CPYTHON_VERSION }} \ | |
| https://github.com/python/cpython.git "$RUNNER_TEMP/cpython-src" | |
| - name: Build CPython with ASAN and UBSAN | |
| working-directory: ${{ runner.temp }}/cpython-src | |
| run: | | |
| CC=clang ./configure \ | |
| --with-address-sanitizer \ | |
| --without-pymalloc \ | |
| --with-undefined-behavior-sanitizer \ | |
| --without-system-libmpdec | |
| make -j"$(nproc)" | |
| - name: Create virtual environment | |
| run: | | |
| "$RUNNER_TEMP/cpython-src/python" -m venv "$RUNNER_TEMP/asan-venv" | |
| - name: Build bocpy | |
| run: | | |
| source "$RUNNER_TEMP/asan-venv/bin/activate" | |
| python -m pip install --upgrade pip | |
| CC="clang -fsanitize=address,undefined -fno-sanitize=vptr" \ | |
| pip install -e .[test] --verbose | |
| - name: Run tests | |
| env: | |
| ASAN_OPTIONS: detect_leaks=0:halt_on_error=1 | |
| UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1 | |
| run: | | |
| source "$RUNNER_TEMP/asan-venv/bin/activate" | |
| pytest -vv -s |