diff --git a/.github/workflows/build_and_publish_test_pypi.yml b/.github/workflows/build_and_publish_test_pypi.yml index d4f847562..120d0f1a1 100644 --- a/.github/workflows/build_and_publish_test_pypi.yml +++ b/.github/workflows/build_and_publish_test_pypi.yml @@ -19,7 +19,7 @@ permissions: env: AWS_ROLE: arn:aws:iam::213020545630:role/github-runner-role AWS_REGION: us-west-1 - PYTHON_VERSIONS: "3.13 3.12 3.11 3.10" + PYTHON_VERSIONS: '["3.13", "3.12", "3.11", "3.10"]' defaults: run: diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 49309f74e..f70b5bbd1 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -84,9 +84,14 @@ jobs: ] build_wheels: - name: Build Python wheels + name: Python ${{ matrix.python_version }} needs: start-self-hosted-runner runs-on: ${{ needs.start-self-hosted-runner.outputs.label }} + strategy: + fail-fast: false + max-parallel: 1 + matrix: + python_version: ${{ fromJSON(inputs.PYTHON_VERSIONS) }} steps: - name: Checkout @@ -122,20 +127,29 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 - - name: Build Python wheels + - name: Build Python wheel run: | - uv python install ${{ inputs.PYTHON_VERSIONS }} + uv python install ${{ matrix.python_version }} cd ${{ github.workspace }}/oxen-python - for version in ${{ inputs.PYTHON_VERSIONS }}; do - uvx --from 'maturin[patchelf]' maturin build --release --interpreter /root/.local/bin/python${version} - done + uvx --from 'maturin[patchelf]' maturin build --release -v \ + --interpreter /root/.local/bin/python${{ matrix.python_version }} \ + 2>&1 | tee /tmp/build.log + + - name: Verify liboxen cache reuse + if: strategy.job-index != 0 + run: | + if grep -q "Compiling liboxen" /tmp/build.log; then + echo "::error::liboxen was recompiled! Rust cache reuse failed." + exit 1 + fi + echo "liboxen correctly reused from cache." - name: Upload wheel artifact uses: actions/upload-artifact@v4 with: - name: wheels-linux-${{ inputs.ARCHITECTURE }} + name: wheels-linux-${{ inputs.ARCHITECTURE }}-py${{ matrix.python_version }} path: ${{ github.workspace }}/oxen-python/target/wheels/*.whl retention-days: 1 diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 02b6cb299..483c55e59 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -25,8 +25,12 @@ defaults: jobs: build_wheels: - name: Build Python wheels + name: Python ${{ matrix.python_version }} runs-on: macos-15-xlarge + strategy: + fail-fast: false + matrix: + python_version: ${{ fromJSON(inputs.PYTHON_VERSIONS) }} steps: - name: Checkout uses: actions/checkout@v4 @@ -52,21 +56,19 @@ jobs: - name: Build Python wheels run: | - uv python install ${{ inputs.PYTHON_VERSIONS }} + uv python install ${{ matrix.python_version }} cd ${{ github.workspace }}/oxen-python rustup target add aarch64-apple-darwin rustup target add x86_64-apple-darwin - for version in ${{ inputs.PYTHON_VERSIONS }}; do - uvx maturin build --release --interpreter /Users/runner/.local/bin/python${version} --target aarch64-apple-darwin - uvx maturin build --release --interpreter /Users/runner/.local/bin/python${version} --target x86_64-apple-darwin - done + uvx maturin build --release --interpreter /Users/runner/.local/bin/python${{ matrix.python_version }} --target aarch64-apple-darwin + uvx maturin build --release --interpreter /Users/runner/.local/bin/python${{ matrix.python_version }} --target x86_64-apple-darwin - name: Upload wheel artifact uses: actions/upload-artifact@v4 with: - name: wheels-macos + name: wheels-macos-py${{ matrix.python_version }} path: ${{ github.workspace }}/oxen-python/target/wheels/*.whl retention-days: 1 diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 9137ee81c..0a453ab43 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -70,9 +70,14 @@ jobs: ] build_wheels: - name: Build Python wheels + name: Python ${{ matrix.python_version }} needs: start-self-hosted-runner runs-on: ${{ needs.start-self-hosted-runner.outputs.label }} + strategy: + fail-fast: false + max-parallel: 1 + matrix: + python_version: ${{ fromJSON(inputs.PYTHON_VERSIONS) }} defaults: run: shell: powershell @@ -122,22 +127,19 @@ jobs: shared-key: "release-python" workspaces: "oxen-python -> target" - - name: Build Python wheels + - name: Build Python wheel run: | refreshenv - uv python install ${{ inputs.PYTHON_VERSIONS }} + uv python install ${{ matrix.python_version }} cd ${{ github.workspace }}\oxen-python - $versions = "${{ inputs.PYTHON_VERSIONS }}" -split ' ' - foreach ($version in $versions) { - uvx maturin build --release --interpreter "C:\Users\Administrator\AppData\Roaming\uv\python\cpython-$version.*\python.exe" - } + uvx maturin build --release --interpreter "C:\Users\Administrator\AppData\Roaming\uv\python\cpython-${{ matrix.python_version }}.*\python.exe" - name: Upload wheel artifact uses: actions/upload-artifact@v4 with: - name: wheels-windows-${{ inputs.ARCHITECTURE }} + name: wheels-windows-${{ inputs.ARCHITECTURE }}-py${{ matrix.python_version }} path: ${{ github.workspace }}\oxen-python\target\wheels\*.whl retention-days: 1