Skip to content

chore: Clean CI a bit #19485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 51 additions & 29 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
- 'editors/code/**'

proc-macro-srv:
needs: changes
if: github.repository == 'rust-lang/rust-analyzer'
name: proc-macro-srv
runs-on: ubuntu-latest
Expand Down Expand Up @@ -72,7 +71,7 @@ jobs:
name: Rust
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: "-D warnings"
RUSTFLAGS: "-Dwarnings"
CC: deny_c

strategy:
Expand All @@ -89,7 +88,7 @@ jobs:
run: |
rustup update --no-self-update stable
rustup default stable
rustup component add --toolchain stable rust-src
rustup component add --toolchain stable rust-src clippy
# We always use a nightly rustfmt, regardless of channel, because we need
# --file-lines.
rustup toolchain install nightly --profile minimal --component rustfmt
Expand All @@ -98,24 +97,24 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: echo "::add-matcher::.github/rust.json"

- name: Bump opt-level
if: matrix.os == 'ubuntu-latest'
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml

- name: Cache Dependencies
uses: Swatinem/rust-cache@27b8ea9368cf428f0bfe41b0876b1a7e809d9844
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
with:
workspaces: |
. -> target
crates/proc-macro-srv/proc-macro-test/imp -> target
./crates/proc-macro-srv/proc-macro-test/imp -> target

- uses: taiki-e/install-action@nextest

- name: Bump opt-level
if: matrix.os == 'ubuntu-latest'
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml

- name: Codegen checks (rust-analyzer)
run: cargo codegen --check

- name: Compile (tests)
run: cargo test --no-run --locked
run: cargo test --no-run

# It's faster to `test` before `build` ¯\_(ツ)_/¯
- name: Compile (rust-analyzer)
Expand All @@ -126,31 +125,53 @@ jobs:
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest' || github.event_name == 'push'
run: cargo nextest run --no-fail-fast --hide-progress-bar --status-level fail

- name: Switch to stable toolchain
- name: clippy
if: matrix.os == 'macos-latest'
run: cargo clippy --all-targets -- -D clippy::disallowed_macros -D clippy::dbg_macro -D clippy::todo -D clippy::print_stdout -D clippy::print_stderr

analysis-stats:
if: github.repository == 'rust-lang/rust-analyzer'
name: miri
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
run: |
rustup update --no-self-update stable
rustup component add --toolchain stable rust-src clippy
rustup default stable
rustup component add rustfmt

- name: Run analysis-stats on rust-analyzer
if: matrix.os == 'ubuntu-latest'
run: target/${{ matrix.target }}/debug/rust-analyzer analysis-stats .
- name: Cache Dependencies
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6

- name: Run analysis-stats on the rust standard libraries
if: matrix.os == 'ubuntu-latest'
- name: ./rust-analyzer
run: cargo run -p rust-analyzer -- analysis-stats . -q

- name: sysroot/lib/rustlib/src/rust/library/
env:
RUSTC_BOOTSTRAP: 1
run: target/${{ matrix.target }}/debug/rust-analyzer analysis-stats --with-deps --no-sysroot --no-test $(rustc --print sysroot)/lib/rustlib/src/rust/library/
run: cargo run -p rust-analyzer -- analysis-stats --with-deps --no-sysroot --no-test $(rustc --print sysroot)/lib/rustlib/src/rust/library/ -q

- name: clippy
if: matrix.os == 'macos-latest'
run: cargo clippy --all-targets -- -D clippy::disallowed_macros -D clippy::dbg_macro -D clippy::todo -D clippy::print_stdout -D clippy::print_stderr
rustfmt:
if: github.repository == 'rust-lang/rust-analyzer'
name: miri
runs-on: ubuntu-latest

- name: rustfmt
if: matrix.os == 'ubuntu-latest'
run: cargo fmt -- --check
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
run: |
rustup update --no-self-update stable
rustup default stable
rustup component add rustfmt

- run: cargo fmt -- --check

# Weird targets to catch non-portable code
miri:
if: github.repository == 'rust-lang/rust-analyzer'
name: miri
Expand All @@ -163,12 +184,13 @@ jobs:
- name: Install Rust toolchain
run: |
rustup update --no-self-update nightly
rustup component add miri --toolchain nightly
rustup default nightly
rustup component add miri

- name: Cache Dependencies
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6

- run: cargo +nightly miri test -p intern --locked
- run: cargo miri test -p intern

# Weird targets to catch non-portable code
rust-cross:
Expand All @@ -193,7 +215,7 @@ jobs:
rustup target add ${{ env.targets }} ${{ env.targets_ide }}

- name: Cache Dependencies
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6

- name: Check
run: |
Expand Down
Loading