Skip to content

Commit

Permalink
Add sdist tests for well-known downstream repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Nov 13, 2023
1 parent daec153 commit a994738
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
@@ -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
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -528,6 +549,7 @@ jobs:
- test-bootstrap
- test-msrv
- test-pyston
- test-downstream
- check
if: always()
runs-on: ubuntu-latest
Expand Down

0 comments on commit a994738

Please sign in to comment.