Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sdist tests for well-known downstream repositories #1849

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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