mirror of
https://github.com/astral-sh/ruff
synced 2026-01-09 15:44:22 -05:00
Bumps the actions group with 1 update: [tj-actions/changed-files](https://github.com/tj-actions/changed-files). Updates `tj-actions/changed-files` from 42 to 43 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/tj-actions/changed-files/releases">tj-actions/changed-files's releases</a>.</em></p> <blockquote> <h2>v43</h2> <h1>Changes in v43.0.0</h1> <h2>🔥🔥 BREAKING CHANGE 🔥🔥</h2> <ul> <li><code>any_{changed, modified, deleted}</code> outputs now return <code>true</code> when no file/directory patterns are specified.</li> </ul> <h2>What's Changed</h2> <ul> <li>Upgraded to v42.1.0 by <a href="https://github.com/tj-actions-bot"><code>@tj-actions-bot</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1977">tj-actions/changed-files#1977</a></li> <li>chore(deps): lock file maintenance by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1979">tj-actions/changed-files#1979</a></li> <li>chore(deps): update dependency <code>@typescript-eslint/parser</code> to v7.2.0 by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1980">tj-actions/changed-files#1980</a></li> <li>chore(deps): update dependency <code>@types/node</code> to v20.11.26 by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1981">tj-actions/changed-files#1981</a></li> <li>chore(deps): update dependency <code>@typescript-eslint/eslint-plugin</code> to v7.2.0 by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1982">tj-actions/changed-files#1982</a></li> <li>chore(deps): update dependency <code>@types/lodash</code> to v4.17.0 by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1983">tj-actions/changed-files#1983</a></li> <li>chore(deps): update peter-evans/create-pull-request action to v6.0.2 by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1984">tj-actions/changed-files#1984</a></li> <li>chore(deps): update dependency <code>@types/node</code> to v20.11.27 by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1987">tj-actions/changed-files#1987</a></li> <li>feat: add support for returning true for <code>any_{changed, modified, deleted}</code> outputs when no patterns are specified by <a href="https://github.com/jackton1"><code>@jackton1</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1988">tj-actions/changed-files#1988</a></li> <li>Updated README.md by <a href="https://github.com/tj-actions-bot"><code>@tj-actions-bot</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1989">tj-actions/changed-files#1989</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/tj-actions/changed-files/compare/v42...v43.0.0">https://github.com/tj-actions/changed-files/compare/v42...v43.0.0</a></p> <hr /> <h2>v43.0.0</h2> <h2>🔥🔥 BREAKING CHANGE 🔥🔥</h2> <ul> <li><code>any_{changed, modified, deleted}</code> outputs now return <code>true</code> when no file/directory patterns are specified.</li> </ul> <h2>What's Changed</h2> <ul> <li>Upgraded to v42.1.0 by <a href="https://github.com/tj-actions-bot"><code>@tj-actions-bot</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1977">tj-actions/changed-files#1977</a></li> <li>chore(deps): lock file maintenance by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1979">tj-actions/changed-files#1979</a></li> <li>chore(deps): update dependency <code>@typescript-eslint/parser</code> to v7.2.0 by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1980">tj-actions/changed-files#1980</a></li> <li>chore(deps): update dependency <code>@types/node</code> to v20.11.26 by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1981">tj-actions/changed-files#1981</a></li> <li>chore(deps): update dependency <code>@typescript-eslint/eslint-plugin</code> to v7.2.0 by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1982">tj-actions/changed-files#1982</a></li> <li>chore(deps): update dependency <code>@types/lodash</code> to v4.17.0 by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1983">tj-actions/changed-files#1983</a></li> <li>chore(deps): update peter-evans/create-pull-request action to v6.0.2 by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1984">tj-actions/changed-files#1984</a></li> <li>chore(deps): update dependency <code>@types/node</code> to v20.11.27 by <a href="https://github.com/renovate"><code>@renovate</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1987">tj-actions/changed-files#1987</a></li> <li>feat: add support for returning true for <code>any_{changed, modified, deleted}</code> outputs when no patterns are specified by <a href="https://github.com/jackton1"><code>@jackton1</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1988">tj-actions/changed-files#1988</a></li> <li>Updated README.md by <a href="https://github.com/tj-actions-bot"><code>@tj-actions-bot</code></a> in <a href="https://redirect.github.com/tj-actions/changed-files/pull/1989">tj-actions/changed-files#1989</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/tj-actions/changed-files/compare/v42...v43.0.0">https://github.com/tj-actions/changed-files/compare/v42...v43.0.0</a></p> <h2>v42.1.0</h2> <p>🚀 🚀 New Feature 🚀 🚀</p> <ul> <li>Use changed-files output to run matrix jobs by simply setting the new <code>matrix</code> input to <code>true</code>.</li> </ul> <p>This serves as an alias for setting the <code>json</code> input to <code>true</code> and the <code>escape_json</code> input to <code>false</code></p> <pre lang="yml"><code></tr></table> </code></pre> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/tj-actions/changed-files/blob/main/HISTORY.md">tj-actions/changed-files's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h1><a href="https://github.com/tj-actions/changed-files/compare/v42.1.0...v43.0.0">43.0.0</a> - (2024-03-13)</h1> <h2><!-- raw HTML omitted -->🚀 Features</h2> <ul> <li>Add support for returning true for <code>any_{changed, modified, deleted}</code> outputs when no patterns are specified (<a href="https://redirect.github.com/tj-actions/changed-files/issues/1988">#1988</a>) (<a href="a5cf6aa30c">a5cf6aa</a>) - (Tonye Jack)</li> </ul> <h2><!-- raw HTML omitted -->🔄 Update</h2> <ul> <li>Updated README.md (<a href="https://redirect.github.com/tj-actions/changed-files/issues/1989">#1989</a>)</li> </ul> <p>Co-authored-by: repo-ranger[bot] <!-- raw HTML omitted --> (<a href="77af4bed28">77af4be</a>) - (tj-actions[bot])</p> <h2><!-- raw HTML omitted -->⚙️ Miscellaneous Tasks</h2> <ul> <li><strong>deps:</strong> Update dependency <code>@types/node</code> to v20.11.27 (<a href="15807c9c84">15807c9</a>) - (renovate[bot])</li> <li><strong>deps:</strong> Update peter-evans/create-pull-request action to v6.0.2 (<a href="dc458cf753">dc458cf</a>) - (renovate[bot])</li> <li><strong>deps:</strong> Update dependency <code>@types/lodash</code> to v4.17.0 (<a href="92ca3eebd0">92ca3ee</a>) - (renovate[bot])</li> <li><strong>deps:</strong> Update dependency <code>@typescript-eslint/eslint-plugin</code> to v7.2.0 (<a href="f591d0c7f0">f591d0c</a>) - (renovate[bot])</li> <li><strong>deps:</strong> Update dependency <code>@types/node</code> to v20.11.26 (<a href="35023362e2">3502336</a>) - (renovate[bot])</li> <li><strong>deps:</strong> Update dependency <code>@typescript-eslint/parser</code> to v7.2.0 (<a href="e436cb6d85">e436cb6</a>) - (renovate[bot])</li> <li><strong>deps:</strong> Lock file maintenance (<a href="257d47dfba">257d47d</a>) - (renovate[bot])</li> </ul> <h2><!-- raw HTML omitted -->⬆️ Upgrades</h2> <ul> <li>Upgraded to v42.1.0 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/1977">#1977</a>)</li> </ul> <p>Co-authored-by: jackton1 <a href="mailto:17484350+jackton1@users.noreply.github.com">17484350+jackton1@users.noreply.github.com</a> (<a href="4918e11830">4918e11</a>) - (tj-actions[bot])</p> <h1><a href="https://github.com/tj-actions/changed-files/compare/v42.0.7...v42.1.0">42.1.0</a> - (2024-03-09)</h1> <h2><!-- raw HTML omitted -->🚀 Features</h2> <ul> <li>Add matrix alias to simplify using outputs for matrix jobs (<a href="https://redirect.github.com/tj-actions/changed-files/issues/1975">#1975</a>) (<a href="008ba8ceec">008ba8c</a>) - (Tonye Jack)</li> </ul> <h2><!-- raw HTML omitted -->🔄 Update</h2> <ul> <li>Updated README.md (<a href="https://redirect.github.com/tj-actions/changed-files/issues/1976">#1976</a>)</li> </ul> <p>Co-authored-by: repo-ranger[bot] <!-- raw HTML omitted --> (<a href="aa08304bd4">aa08304</a>) - (tj-actions[bot])</p> <h2><!-- raw HTML omitted -->⬆️ Upgrades</h2> <ul> <li>Upgraded to v42.0.7 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/1974">#1974</a>)</li> </ul> <p>Co-authored-by: jackton1 <a href="mailto:17484350+jackton1@users.noreply.github.com">17484350+jackton1@users.noreply.github.com</a> (<a href="fe6c3ea0ca">fe6c3ea</a>) - (tj-actions[bot])</p> <h1><a href="https://github.com/tj-actions/changed-files/compare/v42.0.6...v42.0.7">42.0.7</a> - (2024-03-07)</h1> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="77af4bed28"><code>77af4be</code></a> Updated README.md (<a href="https://redirect.github.com/tj-actions/changed-files/issues/1989">#1989</a>)</li> <li><a href="a5cf6aa30c"><code>a5cf6aa</code></a> feat: add support for returning true for <code>any_{changed, modified, deleted}</code> o...</li> <li><a href="15807c9c84"><code>15807c9</code></a> chore(deps): update dependency <code>@types/node</code> to v20.11.27</li> <li><a href="dc458cf753"><code>dc458cf</code></a> chore(deps): update peter-evans/create-pull-request action to v6.0.2</li> <li><a href="92ca3eebd0"><code>92ca3ee</code></a> chore(deps): update dependency <code>@types/lodash</code> to v4.17.0</li> <li><a href="f591d0c7f0"><code>f591d0c</code></a> chore(deps): update dependency <code>@typescript-eslint/eslint-plugin</code> to v7.2.0</li> <li><a href="35023362e2"><code>3502336</code></a> chore(deps): update dependency <code>@types/node</code> to v20.11.26</li> <li><a href="e436cb6d85"><code>e436cb6</code></a> chore(deps): update dependency <code>@typescript-eslint/parser</code> to v7.2.0</li> <li><a href="257d47dfba"><code>257d47d</code></a> chore(deps): lock file maintenance</li> <li><a href="4918e11830"><code>4918e11</code></a> Upgraded to v42.1.0 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/1977">#1977</a>)</li> <li>See full diff in <a href="https://github.com/tj-actions/changed-files/compare/v42...v43">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
536 lines
18 KiB
YAML
536 lines
18 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
CARGO_NET_RETRY: 10
|
|
CARGO_TERM_COLOR: always
|
|
RUSTUP_MAX_RETRIES: 10
|
|
PACKAGE_NAME: ruff
|
|
PYTHON_VERSION: "3.11"
|
|
|
|
jobs:
|
|
determine_changes:
|
|
name: "Determine changes"
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
# Flag that is raised when any code that affects linter is changed
|
|
linter: ${{ steps.changed.outputs.linter_any_changed }}
|
|
# Flag that is raised when any code that affects formatter is changed
|
|
formatter: ${{ steps.changed.outputs.formatter_any_changed }}
|
|
# Flag that is raised when any code is changed
|
|
# This is superset of the linter and formatter
|
|
code: ${{ steps.changed.outputs.code_any_changed }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: tj-actions/changed-files@v43
|
|
id: changed
|
|
with:
|
|
files_yaml: |
|
|
linter:
|
|
- Cargo.toml
|
|
- Cargo.lock
|
|
- crates/**
|
|
- "!crates/ruff_python_formatter/**"
|
|
- "!crates/ruff_formatter/**"
|
|
- "!crates/ruff_dev/**"
|
|
- "!crates/ruff_shrinking/**"
|
|
- scripts/*
|
|
- python/**
|
|
- .github/workflows/ci.yaml
|
|
|
|
formatter:
|
|
- Cargo.toml
|
|
- Cargo.lock
|
|
- crates/ruff_python_formatter/**
|
|
- crates/ruff_formatter/**
|
|
- crates/ruff_python_trivia/**
|
|
- crates/ruff_python_ast/**
|
|
- crates/ruff_source_file/**
|
|
- crates/ruff_python_index/**
|
|
- crates/ruff_text_size/**
|
|
- crates/ruff_python_parser/**
|
|
- crates/ruff_dev/**
|
|
- scripts/*
|
|
- python/**
|
|
- .github/workflows/ci.yaml
|
|
|
|
code:
|
|
- "**/*"
|
|
- "!**/*.md"
|
|
- "!docs/**"
|
|
- "!assets/**"
|
|
|
|
cargo-fmt:
|
|
name: "cargo fmt"
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: "Install Rust toolchain"
|
|
run: rustup component add rustfmt
|
|
- run: cargo fmt --all --check
|
|
|
|
cargo-clippy:
|
|
name: "cargo clippy"
|
|
runs-on: ubuntu-latest
|
|
needs: determine_changes
|
|
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }}
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: "Install Rust toolchain"
|
|
run: |
|
|
rustup component add clippy
|
|
rustup target add wasm32-unknown-unknown
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: "Clippy"
|
|
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
|
|
- name: "Clippy (wasm)"
|
|
run: cargo clippy -p ruff_wasm --target wasm32-unknown-unknown --all-features --locked -- -D warnings
|
|
|
|
cargo-test-linux:
|
|
name: "cargo test (linux)"
|
|
runs-on: ubuntu-latest
|
|
needs: determine_changes
|
|
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }}
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: "Install Rust toolchain"
|
|
run: rustup show
|
|
- name: "Install mold"
|
|
uses: rui314/setup-mold@v1
|
|
- name: "Install cargo nextest"
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: cargo-nextest
|
|
- name: "Install cargo insta"
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: cargo-insta
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: "Run tests"
|
|
shell: bash
|
|
env:
|
|
NEXTEST_PROFILE: "ci"
|
|
run: cargo insta test --all-features --unreferenced reject --test-runner nextest
|
|
|
|
# Check for broken links in the documentation.
|
|
- run: cargo doc --all --no-deps
|
|
env:
|
|
# Setting RUSTDOCFLAGS because `cargo doc --check` isn't yet implemented (https://github.com/rust-lang/cargo/issues/10025).
|
|
RUSTDOCFLAGS: "-D warnings"
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ruff
|
|
path: target/debug/ruff
|
|
|
|
cargo-test-windows:
|
|
name: "cargo test (windows)"
|
|
runs-on: windows-latest
|
|
needs: determine_changes
|
|
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }}
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: "Install Rust toolchain"
|
|
run: rustup show
|
|
- name: "Install cargo nextest"
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: cargo-nextest
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: "Run tests"
|
|
shell: bash
|
|
run: |
|
|
cargo nextest run --all-features --profile ci
|
|
cargo test --all-features --doc
|
|
|
|
cargo-test-wasm:
|
|
name: "cargo test (wasm)"
|
|
runs-on: ubuntu-latest
|
|
needs: determine_changes
|
|
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }}
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: "Install Rust toolchain"
|
|
run: rustup target add wasm32-unknown-unknown
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 18
|
|
cache: "npm"
|
|
cache-dependency-path: playground/package-lock.json
|
|
- uses: jetli/wasm-pack-action@v0.4.0
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: "Run wasm-pack"
|
|
run: |
|
|
cd crates/ruff_wasm
|
|
wasm-pack test --node
|
|
|
|
cargo-fuzz:
|
|
name: "cargo fuzz"
|
|
runs-on: ubuntu-latest
|
|
needs: determine_changes
|
|
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }}
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: "Install Rust toolchain"
|
|
run: rustup show
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: "fuzz -> target"
|
|
- name: "Install cargo-fuzz"
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: cargo-fuzz@0.11.2
|
|
- run: cargo fuzz build -s none
|
|
|
|
scripts:
|
|
name: "test scripts"
|
|
runs-on: ubuntu-latest
|
|
needs: determine_changes
|
|
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }}
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: "Install Rust toolchain"
|
|
run: rustup component add rustfmt
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: ./scripts/add_rule.py --name DoTheThing --prefix PL --code C0999 --linter pylint
|
|
- run: cargo check
|
|
- run: cargo fmt --all --check
|
|
- run: |
|
|
./scripts/add_plugin.py test --url https://pypi.org/project/-test/0.1.0/ --prefix TST
|
|
./scripts/add_rule.py --name FirstRule --prefix TST --code 001 --linter test
|
|
- run: cargo check
|
|
- run: cargo fmt --all --check
|
|
|
|
ecosystem:
|
|
name: "ecosystem"
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- cargo-test-linux
|
|
- determine_changes
|
|
# Only runs on pull requests, since that is the only we way we can find the base version for comparison.
|
|
# Ecosystem check needs linter and/or formatter changes.
|
|
if: github.event_name == 'pull_request' && ${{
|
|
needs.determine_changes.outputs.code == 'true'
|
|
}}
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
|
|
- uses: actions/download-artifact@v4
|
|
name: Download comparison Ruff binary
|
|
id: ruff-target
|
|
with:
|
|
name: ruff
|
|
path: target/debug
|
|
|
|
- uses: dawidd6/action-download-artifact@v3
|
|
name: Download baseline Ruff binary
|
|
with:
|
|
name: ruff
|
|
branch: ${{ github.event.pull_request.base.ref }}
|
|
workflow: "ci.yaml"
|
|
check_artifacts: true
|
|
|
|
- name: Install ruff-ecosystem
|
|
run: |
|
|
pip install ./python/ruff-ecosystem
|
|
|
|
- name: Run `ruff check` stable ecosystem check
|
|
if: ${{ needs.determine_changes.outputs.linter == 'true' }}
|
|
run: |
|
|
# Make executable, since artifact download doesn't preserve this
|
|
chmod +x ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff
|
|
|
|
# Set pipefail to avoid hiding errors with tee
|
|
set -eo pipefail
|
|
|
|
ruff-ecosystem check ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff --cache ./checkouts --output-format markdown | tee ecosystem-result-check-stable
|
|
|
|
cat ecosystem-result-check-stable > $GITHUB_STEP_SUMMARY
|
|
echo "### Linter (stable)" > ecosystem-result
|
|
cat ecosystem-result-check-stable >> ecosystem-result
|
|
echo "" >> ecosystem-result
|
|
|
|
- name: Run `ruff check` preview ecosystem check
|
|
if: ${{ needs.determine_changes.outputs.linter == 'true' }}
|
|
run: |
|
|
# Make executable, since artifact download doesn't preserve this
|
|
chmod +x ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff
|
|
|
|
# Set pipefail to avoid hiding errors with tee
|
|
set -eo pipefail
|
|
|
|
ruff-ecosystem check ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff --cache ./checkouts --output-format markdown --force-preview | tee ecosystem-result-check-preview
|
|
|
|
cat ecosystem-result-check-preview > $GITHUB_STEP_SUMMARY
|
|
echo "### Linter (preview)" >> ecosystem-result
|
|
cat ecosystem-result-check-preview >> ecosystem-result
|
|
echo "" >> ecosystem-result
|
|
|
|
- name: Run `ruff format` stable ecosystem check
|
|
if: ${{ needs.determine_changes.outputs.formatter == 'true' }}
|
|
run: |
|
|
# Make executable, since artifact download doesn't preserve this
|
|
chmod +x ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff
|
|
|
|
# Set pipefail to avoid hiding errors with tee
|
|
set -eo pipefail
|
|
|
|
ruff-ecosystem format ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff --cache ./checkouts --output-format markdown | tee ecosystem-result-format-stable
|
|
|
|
cat ecosystem-result-format-stable > $GITHUB_STEP_SUMMARY
|
|
echo "### Formatter (stable)" >> ecosystem-result
|
|
cat ecosystem-result-format-stable >> ecosystem-result
|
|
echo "" >> ecosystem-result
|
|
|
|
- name: Run `ruff format` preview ecosystem check
|
|
if: ${{ needs.determine_changes.outputs.formatter == 'true' }}
|
|
run: |
|
|
# Make executable, since artifact download doesn't preserve this
|
|
chmod +x ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff
|
|
|
|
# Set pipefail to avoid hiding errors with tee
|
|
set -eo pipefail
|
|
|
|
ruff-ecosystem format ./ruff ${{ steps.ruff-target.outputs.download-path }}/ruff --cache ./checkouts --output-format markdown --force-preview | tee ecosystem-result-format-preview
|
|
|
|
cat ecosystem-result-format-preview > $GITHUB_STEP_SUMMARY
|
|
echo "### Formatter (preview)" >> ecosystem-result
|
|
cat ecosystem-result-format-preview >> ecosystem-result
|
|
echo "" >> ecosystem-result
|
|
|
|
- name: Export pull request number
|
|
run: |
|
|
echo ${{ github.event.number }} > pr-number
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
name: Upload PR Number
|
|
with:
|
|
name: pr-number
|
|
path: pr-number
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
name: Upload Results
|
|
with:
|
|
name: ecosystem-result
|
|
path: ecosystem-result
|
|
|
|
cargo-udeps:
|
|
name: "cargo udeps"
|
|
runs-on: ubuntu-latest
|
|
needs: determine_changes
|
|
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }}
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: "Install nightly Rust toolchain"
|
|
# Only pinned to make caching work, update freely
|
|
run: rustup toolchain install nightly-2023-10-15
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: "Install cargo-udeps"
|
|
uses: taiki-e/install-action@cargo-udeps
|
|
- name: "Run cargo-udeps"
|
|
run: cargo +nightly-2023-10-15 udeps
|
|
|
|
python-package:
|
|
name: "python package"
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
architecture: x64
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: "Prep README.md"
|
|
run: python scripts/transform_readme.py --target pypi
|
|
- name: "Build wheels"
|
|
uses: PyO3/maturin-action@v1
|
|
with:
|
|
args: --out dist
|
|
- name: "Test wheel"
|
|
run: |
|
|
pip install --force-reinstall --find-links dist ${{ env.PACKAGE_NAME }}
|
|
ruff --help
|
|
python -m ruff --help
|
|
- name: "Remove wheels from cache"
|
|
run: rm -rf target/wheels
|
|
|
|
pre-commit:
|
|
name: "pre-commit"
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
- name: "Install Rust toolchain"
|
|
run: rustup show
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: "Install pre-commit"
|
|
run: pip install pre-commit
|
|
- name: "Cache pre-commit"
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/pre-commit
|
|
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
|
- name: "Run pre-commit"
|
|
run: |
|
|
echo '```console' > $GITHUB_STEP_SUMMARY
|
|
# Enable color output for pre-commit and remove it for the summary
|
|
SKIP=cargo-fmt,clippy,dev-generate-all pre-commit run --all-files --show-diff-on-failure --color=always | \
|
|
tee >(sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[mGK]//g' >> $GITHUB_STEP_SUMMARY) >&1
|
|
exit_code=${PIPESTATUS[0]}
|
|
echo '```' >> $GITHUB_STEP_SUMMARY
|
|
exit $exit_code
|
|
|
|
docs:
|
|
name: "mkdocs"
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
env:
|
|
MKDOCS_INSIDERS_SSH_KEY_EXISTS: ${{ secrets.MKDOCS_INSIDERS_SSH_KEY != '' }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
- name: "Add SSH key"
|
|
if: ${{ env.MKDOCS_INSIDERS_SSH_KEY_EXISTS == 'true' }}
|
|
uses: webfactory/ssh-agent@v0.9.0
|
|
with:
|
|
ssh-private-key: ${{ secrets.MKDOCS_INSIDERS_SSH_KEY }}
|
|
- name: "Install Rust toolchain"
|
|
run: rustup show
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: "Install Insiders dependencies"
|
|
if: ${{ env.MKDOCS_INSIDERS_SSH_KEY_EXISTS == 'true' }}
|
|
run: pip install -r docs/requirements-insiders.txt
|
|
- name: "Install dependencies"
|
|
if: ${{ env.MKDOCS_INSIDERS_SSH_KEY_EXISTS != 'true' }}
|
|
run: pip install -r docs/requirements.txt
|
|
- name: "Update README File"
|
|
run: python scripts/transform_readme.py --target mkdocs
|
|
- name: "Generate docs"
|
|
run: python scripts/generate_mkdocs.py
|
|
- name: "Check docs formatting"
|
|
run: python scripts/check_docs_formatted.py
|
|
- name: "Build Insiders docs"
|
|
if: ${{ env.MKDOCS_INSIDERS_SSH_KEY_EXISTS == 'true' }}
|
|
run: mkdocs build --strict -f mkdocs.insiders.yml
|
|
- name: "Build docs"
|
|
if: ${{ env.MKDOCS_INSIDERS_SSH_KEY_EXISTS != 'true' }}
|
|
run: mkdocs build --strict -f mkdocs.public.yml
|
|
|
|
check-formatter-instability-and-black-similarity:
|
|
name: "formatter instabilities and black similarity"
|
|
runs-on: ubuntu-latest
|
|
needs: determine_changes
|
|
if: needs.determine_changes.outputs.formatter == 'true' || github.ref == 'refs/heads/main'
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: "Install Rust toolchain"
|
|
run: rustup show
|
|
- name: "Cache rust"
|
|
uses: Swatinem/rust-cache@v2
|
|
- name: "Formatter progress"
|
|
run: scripts/formatter_ecosystem_checks.sh
|
|
- name: "Github step summary"
|
|
run: cat target/progress_projects_stats.txt > $GITHUB_STEP_SUMMARY
|
|
- name: "Remove checkouts from cache"
|
|
run: rm -r target/progress_projects
|
|
|
|
check-ruff-lsp:
|
|
name: "test ruff-lsp"
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
needs:
|
|
- cargo-test-linux
|
|
- determine_changes
|
|
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }}
|
|
steps:
|
|
- uses: extractions/setup-just@v2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: actions/checkout@v4
|
|
name: "Download ruff-lsp source"
|
|
with:
|
|
repository: "astral-sh/ruff-lsp"
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
|
|
- uses: actions/download-artifact@v4
|
|
name: Download development ruff binary
|
|
id: ruff-target
|
|
with:
|
|
name: ruff
|
|
path: target/debug
|
|
|
|
- name: Install ruff-lsp dependencies
|
|
run: |
|
|
just install
|
|
|
|
- name: Run ruff-lsp tests
|
|
run: |
|
|
# Setup development binary
|
|
pip uninstall --yes ruff
|
|
chmod +x ${{ steps.ruff-target.outputs.download-path }}/ruff
|
|
export PATH=${{ steps.ruff-target.outputs.download-path }}:$PATH
|
|
ruff version
|
|
|
|
just test
|
|
|
|
benchmarks:
|
|
runs-on: ubuntu-latest
|
|
needs: determine_changes
|
|
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }}
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: "Checkout Branch"
|
|
uses: actions/checkout@v4
|
|
|
|
- name: "Install Rust toolchain"
|
|
run: rustup show
|
|
|
|
- name: "Install codspeed"
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: cargo-codspeed
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- name: "Build benchmarks"
|
|
run: cargo codspeed build --features codspeed -p ruff_benchmark
|
|
|
|
- name: "Run benchmarks"
|
|
uses: CodSpeedHQ/action@v2
|
|
with:
|
|
run: cargo codspeed run
|
|
token: ${{ secrets.CODSPEED_TOKEN }}
|