Defer explicit free and destroy #52
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: Build and Publish Wheels | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 11-memory-leak | |
| release: | |
| types: [published] | |
| workflow_dispatch: # Allows manual triggering | |
| jobs: | |
| build_wheels: | |
| name: Build wheel on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # Required for setuptools_scm to work | |
| - name: Setup Zig Compiler | |
| uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.15.1 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: Install build tools | |
| run: pip install .[build] | |
| - name: Check build version | |
| run: python3 -m setuptools_scm | |
| - name: Build Zig binary | |
| run: zig build -Doptimize=ReleaseFast --prefix volt | |
| - name: Check binaries | |
| if: runner.debug == '1' | |
| run: | | |
| file zig-out/lib/* | |
| - name: Build wheel | |
| run: python -m build | |
| env: | |
| MACOSX_DEPLOYMENT_TARGET: 15.7 | |
| - name: Install auditwheel (Linux only) | |
| if: runner.os == 'Linux' | |
| run: pip install auditwheel | |
| - name: Repair wheel with auditwheel (Linux only) | |
| if: runner.os == 'Linux' | |
| run: | | |
| auditwheel repair dist/*.whl -w dist/ | |
| rm dist/*-linux_*.whl # Remove the non-manylinux wheel | |
| - name: Check wheel | |
| run: | | |
| pip install twine | |
| twine check dist/* | |
| - name: Install built wheel | |
| run: pip install dist/*.whl | |
| - name: Install maintainer requirements for testing | |
| run: pip install .[maintainer] | |
| - name: Run tests | |
| run: pytest | |
| env: | |
| NO_LOGS: true | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheel-${{ matrix.os }} | |
| path: dist/*.whl | |
| retention-days: 7 | |
| # Upload to Test PyPI on every push to main | |
| upload_test_pypi: | |
| name: Upload to Test PyPI | |
| needs: [build_wheels] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi-test | |
| url: https://test.pypi.org/project/volt-framework/ | |
| permissions: | |
| id-token: write | |
| if: github.event_name == 'push' | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheel-* | |
| merge-multiple: true | |
| path: dist | |
| - name: Publish to Test PyPI (Debugging) | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| skip-existing: true | |
| verbose: true | |
| if: runner.debug == '1' | |
| - name: Publish to Test PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| skip-existing: true | |
| if: runner.debug == '0' | |
| # Upload to production PyPI only on releases | |
| upload_pypi: | |
| name: Upload to PyPI | |
| needs: [build_wheels] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/volt-framework/ | |
| permissions: | |
| id-token: write | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheel-* | |
| merge-multiple: true | |
| path: dist | |
| - name: Publish to PyPI (Debugging) | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| if: runner.debug == '1' | |
| with: | |
| verbose: true | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| if: runner.debug == '0' |