From a99473872895b129e03202c6b81ec507914d926d Mon Sep 17 00:00:00 2001 From: messense Date: Mon, 13 Nov 2023 21:09:56 +0800 Subject: [PATCH] Add sdist tests for well-known downstream repositories --- .github/workflows/downstream.yml | 38 ++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 22 ++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/downstream.yml diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml new file mode 100644 index 000000000..3d3acf7e1 --- /dev/null +++ b/.github/workflows/downstream.yml @@ -0,0 +1,38 @@ +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 }} + submodules: 'recursive' + 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..e6393951e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -493,6 +493,27 @@ 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" + check: name: Check ${{ matrix.platform.target }} if: github.event_name != 'pull_request' @@ -528,6 +549,7 @@ jobs: - test-bootstrap - test-msrv - test-pyston + - test-downstream - check if: always() runs-on: ubuntu-latest