Skip to content

Invariance and typeshed generics #7

Invariance and typeshed generics

Invariance and typeshed generics #7

name: by ecosystem round-trip
permissions: {}
on:
pull_request:
paths:
- "crates/by_transforms/**"
- "crates/ty/**"
- "crates/ruff_python_ast/**"
- "crates/ruff_python_parser/**"
- "crates/ruff_python_codegen/**"
- "scripts/check_ecosystem_roundtrip.py"
- "scripts/setup_primer_project.py"
- "crates/ty_python_semantic/resources/primer/**"
- ".github/workflows/by-ecosystem-roundtrip.yaml"
- "Cargo.lock"
- "!**.md"
- "!**.snap"
concurrency:
group: by-ecosystem-roundtrip-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
defaults:
run:
shell: bash
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: 1
CARGO_PROFILE_PROFILING_DEBUG: line-tables-only
jobs:
roundtrip:
name: Round-trip primer projects
runs-on: ${{ github.repository == 'KotlinIsland/basedpython' && 'depot-ubuntu-22.04-32' || 'ubuntu-latest' }}
# max (6h) so the round-trip over the primer project set isn't cut short
timeout-minutes: 360
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- name: Install Rust toolchain
run: rustup show
- name: Install mold
uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
version: "0.11.7"
- name: Build by
run: cargo build --bin by --profile profiling
- name: Run round-trip ecosystem check
env:
BY_BIN: ${{ github.workspace }}/target/profiling/by
PRIMER_LIMIT: ${{ vars.BY_ROUNDTRIP_PRIMER_LIMIT || '20' }}
run: |
chmod +x "$BY_BIN"
set +e
uv run scripts/check_ecosystem_roundtrip.py \
"$BY_BIN" \
--limit "$PRIMER_LIMIT" \
--project-concurrency 4 \
--file-concurrency 8 \
> report.md
ROUNDTRIP_EXIT=$?
set -e
cat report.md >> "$GITHUB_STEP_SUMMARY"
echo "exit_code=$ROUNDTRIP_EXIT" >> "$GITHUB_OUTPUT"
id: check
- name: Upload report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: by-roundtrip-report
path: report.md
- name: Fail on round-trip divergence
if: steps.check.outputs.exit_code != '0'
run: exit 1