mirror of
https://github.com/astral-sh/ruff.git
synced 2026-11-22 05:20:36 +08:00
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/download-artifact](https://redirect.github.com/actions/download-artifact) | action | patch | `v8.0.1` → `v8.0.2` | | [actions/upload-artifact](https://redirect.github.com/actions/upload-artifact) | action | patch | `v7.0.1` → `v7.0.2` | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/10578) for more information. --- ### Release Notes <details> <summary>actions/download-artifact</summary> ### [`v8.0.2`](https://redirect.github.com/actions/download-artifact/releases/tag/v8.0.2) [Compare Source](https://redirect.github.com/actions/download-artifact/compare/v8.0.1...v8.0.2) #### What's Changed - Update the readme by [@​danwkennedy](https://redirect.github.com/danwkennedy) in [#​473](https://redirect.github.com/actions/download-artifact/pull/473) - Improves artifact download retries when the service returns HTTP 429 (rate limiting), including honoring valid Retry-After headers. - Update [@​actions/artifact](https://redirect.github.com/actions/artifact) to 6.3.1 by [@​tunc-d](https://redirect.github.com/tunc-d) in [#​492](https://redirect.github.com/actions/download-artifact/pull/492) - Prepare download-artifact v8.0.2 by [@​tunc-d](https://redirect.github.com/tunc-d) in [#​493](https://redirect.github.com/actions/download-artifact/pull/493) #### New Contributors - [@​tunc-d](https://redirect.github.com/tunc-d) made their first contribution in [#​492](https://redirect.github.com/actions/download-artifact/pull/492) **Full Changelog**: <https://github.com/actions/download-artifact/compare/v8.0.1...v8.0.2> </details> <details> <summary>actions/upload-artifact</summary> ### [`v7.0.2`](https://redirect.github.com/actions/upload-artifact/releases/tag/v7.0.2) [Compare Source](https://redirect.github.com/actions/upload-artifact/compare/v7.0.1...v7.0.2) #### What's Changed - Improves artifact download retries when the service returns HTTP 429 (rate limiting), including honoring valid Retry-After headers. - Updates [@​actions/artifact](https://redirect.github.com/actions/artifact) to v6.3.1. #### New Contributors - [@​tunc-d](https://redirect.github.com/tunc-d) made their first contribution in [#​821](https://redirect.github.com/actions/upload-artifact/pull/821) **Full Changelog**: <https://github.com/actions/upload-artifact/compare/v7.0.1...v7.0.2> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 4am on Wednesday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/astral-sh/ruff). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMjIuNSIsInVwZGF0ZWRJblZlciI6IjQ0LjIyMi41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
146 lines
4.8 KiB
YAML
146 lines
4.8 KiB
YAML
name: Run memory report
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
# Third-party builds must not write caches consumed by other jobs.
|
|
# GitHub-hosted runners use GitHub's cache service, which enforces this mode.
|
|
cache-mode: read
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "crates/ty*/**"
|
|
- "!crates/ty_ide/**"
|
|
- "!crates/ty_server/**"
|
|
- "!crates/ty_test/**"
|
|
- "!crates/ty_completion_eval/**"
|
|
- "!crates/ty_wasm/**"
|
|
- "crates/ruff_db/**"
|
|
- "crates/ruff_python_ast/**"
|
|
- "crates/ruff_python_edits/**"
|
|
- "crates/ruff_python_parser/**"
|
|
- "scripts/memory_report.py"
|
|
- ".github/workflows/memory_report.yaml"
|
|
- ".github/actions/setup-ruff-workspace/action.yml"
|
|
- "Cargo.lock"
|
|
- "!**.md"
|
|
- "!**.snap"
|
|
# It's tempting to skip all Python files in every directory,
|
|
# but changes to Python files in `ty_vendored` can affect the output of ecosystem runs,
|
|
# so we apply a narrow exemption for all files in the corpus directory instead.
|
|
- "!crates/ty_python_semantic/resources/corpus/**"
|
|
|
|
concurrency:
|
|
group: memory-report-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
env:
|
|
UV_LOCKED: 1
|
|
CARGO_INCREMENTAL: 0
|
|
CARGO_NET_RETRY: 10
|
|
CARGO_TERM_COLOR: always
|
|
RUSTUP_MAX_RETRIES: 10
|
|
RUST_BACKTRACE: 1
|
|
# Line-tables-only debug info: faster builds, backtraces still work.
|
|
CARGO_PROFILE_PROFILING_DEBUG: line-tables-only
|
|
PYTHON_VERSION: 3.14
|
|
|
|
jobs:
|
|
memory_report:
|
|
name: Compute memory usage diff
|
|
runs-on: ${{ github.repository == 'astral-sh/ruff' && 'github-ubuntu-24.04-x86_64-32' || 'ubuntu-latest' }}
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
path: ruff
|
|
persist-credentials: false
|
|
|
|
# Faster to do this separately than to use `fetch-depth: 0` with `actions/checkout`
|
|
- name: Fetch full history without tags
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
gh auth setup-git
|
|
git -C ruff fetch --no-tags --filter=blob:none --unshallow origin
|
|
|
|
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
|
|
with:
|
|
workspaces: "ruff"
|
|
save-if: false
|
|
|
|
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
with:
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
|
|
- uses: $/.github/actions/setup-ruff-workspace
|
|
with:
|
|
enable-cache: true
|
|
save-cache: false
|
|
|
|
- name: Install Rust toolchain
|
|
run: rustup show
|
|
|
|
- name: Compute memory usage diff
|
|
shell: bash
|
|
env:
|
|
TY_MEMORY_REPORT: json
|
|
# Disabling multithreading improves the stability of memory usage numbers.
|
|
TY_MAX_PARALLELISM: 1
|
|
run: |
|
|
# Build the executable for the old and new commit
|
|
(
|
|
cd ruff
|
|
|
|
echo "new commit"
|
|
git rev-list --format=%s --max-count=1 "$GITHUB_SHA"
|
|
cargo build --bin ty --profile profiling
|
|
mv target/profiling/ty ty-new
|
|
|
|
# The first parent contains any preceding layers in a stacked pull request.
|
|
MERGE_BASE="$(git rev-parse "${GITHUB_SHA}^1")"
|
|
git checkout -b old_commit "$MERGE_BASE"
|
|
echo "old commit (merge base)"
|
|
git rev-list --format=%s --max-count=1 old_commit
|
|
cargo build --bin ty --profile profiling
|
|
mv target/profiling/ty ty-old
|
|
)
|
|
|
|
(
|
|
echo "Creating comment with memory comparison"
|
|
cd ruff
|
|
git switch - --detach
|
|
|
|
python "./scripts/memory_report.py" run \
|
|
--old-ty "./ty-old" \
|
|
--new-ty "./ty-new" \
|
|
--projects-dir "${GITHUB_WORKSPACE}/memory_projects" \
|
|
--output ../memory_report_diff.diff
|
|
)
|
|
|
|
- name: Upload diff
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: memory_report_diff
|
|
path: memory_report_diff.diff
|
|
|
|
publish-report:
|
|
needs: memory_report
|
|
if: >-
|
|
!cancelled() && github.event_name == 'pull_request' &&
|
|
github.repository == 'astral-sh/ruff' &&
|
|
github.event.pull_request.head.repo.full_name == github.repository &&
|
|
(needs.memory_report.result == 'success' || needs.memory_report.result == 'failure')
|
|
uses: astral-sh/ruff/.github/workflows/publish-pull-request-report.yml@main # zizmor: ignore[unpinned-uses]
|
|
secrets:
|
|
KV_API_URL: ${{ secrets.KV_API_URL }}
|
|
STS_API_URL: ${{ secrets.STS_API_URL }}
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
with:
|
|
report: memory
|
|
artifact: memory_report_diff
|
|
filename: memory_report_diff.diff
|