feat: add option to allow interactive debugger in python #906
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Cargo CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| script-tests: | |
| name: Script tests (Python 3.12) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install ShellCheck | |
| shell: bash | |
| run: bash scripts/ci_install_shellcheck.sh | |
| - name: Shell script checks | |
| shell: bash | |
| run: bash scripts/ci_check_shell_scripts.sh | |
| - name: Python script tests | |
| run: | | |
| PYTHONPATH=scripts python3 -m unittest \ | |
| scripts.tests.test_python_version_sh \ | |
| scripts.tests.test_resolve_pyo3_python \ | |
| scripts.tests.test_ci_python_version \ | |
| scripts.tests.test_format_benchmark_summary \ | |
| scripts.tests.test_compare_benchmark_summary \ | |
| scripts.tests.test_patch_dist_installer \ | |
| scripts.tests.test_detect_uv_python \ | |
| scripts.tests.test_fix_python_dylib | |
| lint: | |
| name: Lint (stable, Python 3.12) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| rustflags: "" | |
| - name: Setup uv & Python | |
| uses: ./.github/actions/setup-uv-python | |
| with: | |
| python-version: "3.12" | |
| - name: PyO3 diagnostics | |
| shell: bash | |
| run: bash scripts/ci_pyo3_diagnostics.sh | |
| - name: Format check | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-targets --all-features -- -D warnings | |
| hawk: | |
| name: Hawk visibility analysis | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: 1.97.1 | |
| rustflags: "" | |
| - name: Setup uv & Python | |
| uses: ./.github/actions/setup-uv-python | |
| with: | |
| python-version: "3.12" | |
| - name: Install Hawk | |
| env: | |
| # renovate: datasource=github-releases depName=astral-sh/hawk | |
| HAWK_VERSION: "0.1.9" | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -LsSf \ | |
| "https://github.com/astral-sh/hawk/releases/download/${HAWK_VERSION}/cargo-hawk-installer.sh" | sh | |
| - name: Hawk | |
| run: cargo +1.97.1 hawk check --target-dir target/hawk -D warnings | |
| test: | |
| name: Tests (${{ matrix.toolchain }}, Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - toolchain: stable | |
| python-version: "3.12" | |
| - toolchain: stable | |
| python-version: "3.13" | |
| - toolchain: beta | |
| python-version: "3.12" | |
| - toolchain: nightly | |
| python-version: "3.12" | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| rustflags: "" | |
| - name: Setup uv & Python | |
| id: python | |
| uses: ./.github/actions/setup-uv-python | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: PyO3 diagnostics | |
| shell: bash | |
| run: bash scripts/ci_pyo3_diagnostics.sh | |
| - name: Test | |
| env: | |
| PYTHON_PREFIX: ${{ steps.python.outputs.python-prefix }} | |
| run: bash scripts/ci_run_with_python_lib_path.sh "${PYTHON_PREFIX}" cargo test --workspace --all-features | |
| - name: Benchmark fixture (parser repeat) | |
| if: matrix.toolchain == 'stable' && matrix.python-version == '3.12' | |
| env: | |
| PYTHON_PREFIX: ${{ steps.python.outputs.python-prefix }} | |
| R2X_BENCHMARK_SUMMARY_PATH: ${{ runner.temp }}/r2x-plugin-benchmark.txt | |
| run: bash scripts/ci_run_with_python_lib_path.sh "${PYTHON_PREFIX}" cargo test -p r2x test_run_plugin_benchmark_repeat_outputs_summary -- --nocapture | |
| - name: Format benchmark summary table | |
| if: matrix.toolchain == 'stable' && matrix.python-version == '3.12' | |
| run: bash scripts/ci_format_benchmark_summary.sh "${{ runner.temp }}/r2x-plugin-benchmark.txt" "${{ runner.temp }}/r2x-plugin-benchmark.md" | |
| - name: Download baseline benchmark artifact | |
| if: matrix.toolchain == 'stable' && matrix.python-version == '3.12' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: bash scripts/ci_download_benchmark_baseline.sh "${{ runner.temp }}/baseline-benchmark" "${{ github.repository }}" "${{ github.run_id }}" "${{ github.server_url }}" | |
| - name: Compare benchmark against baseline | |
| if: matrix.toolchain == 'stable' && matrix.python-version == '3.12' && env.BASELINE_BENCHMARK_PATH != '' | |
| run: bash scripts/ci_compare_benchmark_baseline.sh "${BASELINE_BENCHMARK_PATH}" "${{ runner.temp }}/r2x-plugin-benchmark.txt" "${{ runner.temp }}/r2x-plugin-benchmark-delta.md" "${BASELINE_BENCHMARK_RUN_ID}" "${BASELINE_BENCHMARK_RUN_URL}" | |
| - name: Upload benchmark summary | |
| if: matrix.toolchain == 'stable' && matrix.python-version == '3.12' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: r2x-plugin-benchmark-summary | |
| path: | | |
| ${{ runner.temp }}/r2x-plugin-benchmark.txt | |
| ${{ runner.temp }}/r2x-plugin-benchmark.md | |
| ${{ runner.temp }}/r2x-plugin-benchmark-delta.md | |
| if-no-files-found: error | |
| release-readiness: | |
| name: Release readiness (publish dry-run) | |
| runs-on: ubuntu-latest | |
| env: | |
| R2X_PYTHON_VERSION: "3.12" | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| rustflags: "" | |
| - name: Setup uv & Python | |
| uses: ./.github/actions/setup-uv-python | |
| with: | |
| python-version: ${{ env.R2X_PYTHON_VERSION }} | |
| - name: PyO3 diagnostics | |
| shell: bash | |
| run: bash scripts/ci_pyo3_diagnostics.sh | |
| - name: Cargo publish dry-run | |
| run: cargo publish --workspace --dry-run |