mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 14:21:24 +00:00
Separate Windows tests from Linux tests (#8287)
Windows tests take much longer and downstream CI jobs that require the build from the Linux tests must wait to start. Additionally, we already have if/else logic in the test suite for Windows tests which cannot run the same command. This will require an update to the required checks in the repository settings.
This commit is contained in:
parent
097e703071
commit
40c886c3bc
1 changed files with 32 additions and 25 deletions
57
.github/workflows/ci.yaml
vendored
57
.github/workflows/ci.yaml
vendored
|
@ -82,12 +82,9 @@ jobs:
|
||||||
- name: "Clippy (wasm)"
|
- name: "Clippy (wasm)"
|
||||||
run: cargo clippy -p ruff_wasm --target wasm32-unknown-unknown --all-features -- -D warnings
|
run: cargo clippy -p ruff_wasm --target wasm32-unknown-unknown --all-features -- -D warnings
|
||||||
|
|
||||||
cargo-test:
|
cargo-test-linux:
|
||||||
strategy:
|
runs-on: ubuntu-latest
|
||||||
matrix:
|
name: "cargo test (linux)"
|
||||||
os: [ubuntu-latest, windows-latest]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
name: "cargo test | ${{ matrix.os }}"
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: "Install Rust toolchain"
|
- name: "Install Rust toolchain"
|
||||||
|
@ -97,40 +94,34 @@ jobs:
|
||||||
with:
|
with:
|
||||||
tool: cargo-insta
|
tool: cargo-insta
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- name: "Run tests (Ubuntu)"
|
- name: "Run tests"
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
||||||
run: cargo insta test --all --all-features --unreferenced reject
|
run: cargo insta test --all --all-features --unreferenced reject
|
||||||
- name: "Run tests (Windows)"
|
|
||||||
if: ${{ matrix.os == 'windows-latest' }}
|
|
||||||
shell: bash
|
|
||||||
# We can't reject unreferenced snapshots on windows because flake8_executable can't run on windows
|
|
||||||
run: cargo insta test --all --all-features
|
|
||||||
# Check for broken links in the documentation.
|
# Check for broken links in the documentation.
|
||||||
- run: cargo doc --all --no-deps
|
- run: cargo doc --all --no-deps
|
||||||
env:
|
env:
|
||||||
# Setting RUSTDOCFLAGS because `cargo doc --check` isn't yet implemented (https://github.com/rust-lang/cargo/issues/10025).
|
# Setting RUSTDOCFLAGS because `cargo doc --check` isn't yet implemented (https://github.com/rust-lang/cargo/issues/10025).
|
||||||
RUSTDOCFLAGS: "-D warnings"
|
RUSTDOCFLAGS: "-D warnings"
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
||||||
with:
|
with:
|
||||||
name: ruff
|
name: ruff
|
||||||
path: target/debug/ruff
|
path: target/debug/ruff
|
||||||
|
|
||||||
cargo-fuzz:
|
cargo-test-windows:
|
||||||
runs-on: ubuntu-latest
|
runs-on: windows-latest
|
||||||
name: "cargo fuzz"
|
name: "cargo test (windows)"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: "Install Rust toolchain"
|
- name: "Install Rust toolchain"
|
||||||
run: rustup show
|
run: rustup show
|
||||||
- uses: Swatinem/rust-cache@v2
|
- name: "Install cargo insta"
|
||||||
with:
|
|
||||||
workspaces: "fuzz -> target"
|
|
||||||
- name: "Install cargo-fuzz"
|
|
||||||
uses: taiki-e/install-action@v2
|
uses: taiki-e/install-action@v2
|
||||||
with:
|
with:
|
||||||
tool: cargo-fuzz@0.11
|
tool: cargo-insta
|
||||||
- run: cargo fuzz build -s none
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
- name: "Run tests"
|
||||||
|
shell: bash
|
||||||
|
# We can't reject unreferenced snapshots on windows because flake8_executable can't run on windows
|
||||||
|
run: cargo insta test --all --all-features
|
||||||
|
|
||||||
cargo-test-wasm:
|
cargo-test-wasm:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -151,6 +142,22 @@ jobs:
|
||||||
cd crates/ruff_wasm
|
cd crates/ruff_wasm
|
||||||
wasm-pack test --node
|
wasm-pack test --node
|
||||||
|
|
||||||
|
cargo-fuzz:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: "cargo fuzz"
|
||||||
|
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
|
||||||
|
- run: cargo fuzz build -s none
|
||||||
|
|
||||||
scripts:
|
scripts:
|
||||||
name: "test scripts"
|
name: "test scripts"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -172,7 +179,7 @@ jobs:
|
||||||
name: "ecosystem"
|
name: "ecosystem"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- cargo-test
|
- cargo-test-linux
|
||||||
- determine_changes
|
- determine_changes
|
||||||
# Only runs on pull requests, since that is the only we way we can find the base version for comparison.
|
# Only runs on pull requests, since that is the only we way we can find the base version for comparison.
|
||||||
if: github.event_name == 'pull_request' && needs.determine_changes.outputs.linter == 'true'
|
if: github.event_name == 'pull_request' && needs.determine_changes.outputs.linter == 'true'
|
||||||
|
@ -340,7 +347,7 @@ jobs:
|
||||||
check-ruff-lsp:
|
check-ruff-lsp:
|
||||||
name: "test ruff-lsp"
|
name: "test ruff-lsp"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: cargo-test
|
needs: cargo-test-linux
|
||||||
steps:
|
steps:
|
||||||
- uses: extractions/setup-just@v1
|
- uses: extractions/setup-just@v1
|
||||||
env:
|
env:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue