User/hendler/0.3.4 #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: Python (jacspy crate) | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths: # Optional: Trigger only on changes within jacspy/ or relevant files | |
| - 'jacspy/**' | |
| - 'jacs/**' # jacspy depends on jacs | |
| - '.github/workflows/python.yml' | |
| pull_request: | |
| branches: [ "main" ] | |
| paths: # Optional: Trigger only on changes within jacspy/ or relevant files | |
| - 'jacspy/**' | |
| - 'jacs/**' # jacspy depends on jacs | |
| - '.github/workflows/python.yml' | |
| workflow_dispatch: # Allows manual triggering | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| # Job to run tests on every push/PR | |
| test-jacspy: | |
| name: Test jacspy crate (x86_64) | |
| runs-on: ubuntu-latest # Docker is available on ubuntu-latest runners (x86_64) | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image for testing (x86_64) | |
| working-directory: jacspy # Directory containing DockerfileBuilder | |
| run: docker buildx build --tag "jacs-build-x86_64" -f DockerfileBuilder . --load # --load makes image available | |
| - name: Run jacspy tests in Docker (x86_64) | |
| working-directory: jacspy # To match PWD context if needed by scripts | |
| env: | |
| RUST_BACKTRACE: "1" | |
| run: | | |
| docker run --rm \ | |
| -v "$(pwd)/..:/workspace" \ | |
| jacs-build-x86_64 \ | |
| bash -c "cd /workspace/jacspy && cargo test --verbose" | |
| # Job to build wheels, runs ONLY on push to main | |
| build-jacspy-wheels: | |
| name: Build jacspy wheels on ${{ matrix.os }} | |
| # Condition: Only run on push events to the main branch | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| needs: test-jacspy # Optional: Ensure tests pass before building wheels | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-14, macos-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Needed for cibuildwheel versioning | |
| - name: Set up QEMU (Linux only) | |
| if: runner.os == 'Linux' | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: all | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install cibuildwheel | |
| run: python -m pip install cibuildwheel | |
| - name: Build wheels | |
| # Run cibuildwheel from the root, but it should detect ./JACS/jacspy/pyproject.toml | |
| # Or use working-directory: JACS/jacspy | |
| run: cibuildwheel --output-dir wheelhouse jacspy | |
| env: | |
| # === cibuildwheel configuration === | |
| # Build architectures | |
| CIBW_ARCHS_LINUX: "x86_64 aarch64" | |
| CIBW_ARCHS_MACOS: "x86_64 aarch64" # Build both Intel and ARM on macOS runners | |
| # Skip PyPy builds | |
| CIBW_SKIP: "pp*" | |
| # Python versions to build for (align with pyproject.toml requires-python) | |
| CIBW_BUILD: "cp311-* cp312-* cp313-*" # Example: Build for 3.11, 3.12, 3.13 | |
| # Linux specific dependencies (if needed inside manylinux container) | |
| # CIBW_BUILD_DEPENDS_LINUX: "openssl-devel" | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-jacspy-${{ matrix.os }} | |
| # Path is relative to GITHUB_WORKSPACE (repo root) | |
| path: ./wheelhouse/*.whl |