diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml new file mode 100644 index 000000000..ff0905e4c --- /dev/null +++ b/.github/workflows/downstream.yml @@ -0,0 +1,37 @@ +on: + workflow_call: + inputs: + repository: + required: true + type: string + manifest-dir: + required: true + type: string + +jobs: + sdist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Sccache Setup + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.5.3" + - name: Build maturin + env: + RUST_BACKTRACE: "1" + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" + run: cargo build + - uses: actions/checkout@v4 + with: + repository: ${{ inputs.repository }} + path: downstream + - name: maturin sdist + working-directory: downstream + run: | + ../target/debug/maturin sdist --manifest-path ${{ inputs.manifest-dir }}/Cargo.toml -o target/sdist + - name: Build from sdist + working-directory: downstream + run: | + ../target/debug/maturin build --manifest-path ${{ inputs.manifest-dir }}/Cargo.toml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 552fb811a..408e3e5c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -493,6 +493,29 @@ jobs: # unset GITHUB_ACTIONS env var to disable zig and conda related tests env -u GITHUB_ACTIONS cargo nextest run --features password-storage + test-downstream: + name: Test downstream - ${{ matrix.downstream.repository }} + if: ${{ contains(github.event.pull_request.labels.*.name, 'sdist') && github.event_name == 'pull_request' }} + uses: ./.github/workflows/downstream.yml + with: + repository: ${{ matrix.downstream.repository }} + manifest-dir: ${{ matrix.downstream.manifest-dir }} + strategy: + matrix: + downstream: + - repository: "pola-rs/polars" + manifest-dir: "py-polars" + - repository: "astral-sh/ruff" + manifest-dir: "crates/ruff_cli" + - repository: "crate-ci/typos" + manifest-dir: "crates/typos-cli" + - repository: "ast-grep/ast-grep" + manifest-dir: "crates/pyo3" + - repository: "oxigraph/oxigraph" + manifest-dir: "python" + - repository: "geoarrow/geoarrow-rs" + manifest-dir: "python/geoarrow-rust" + check: name: Check ${{ matrix.platform.target }} if: github.event_name != 'pull_request' @@ -528,6 +551,7 @@ jobs: - test-bootstrap - test-msrv - test-pyston + - test-downstream - check if: always() runs-on: ubuntu-latest