mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-30 03:27:44 +00:00
Merge pull request #19485 from Veykril/push-mqlnvzkuplnm
chore: Clean CI a bit
This commit is contained in:
commit
8a84c2bc28
1 changed files with 59 additions and 37 deletions
96
.github/workflows/ci.yaml
vendored
96
.github/workflows/ci.yaml
vendored
|
|
@ -34,7 +34,6 @@ jobs:
|
||||||
- 'editors/code/**'
|
- 'editors/code/**'
|
||||||
|
|
||||||
proc-macro-srv:
|
proc-macro-srv:
|
||||||
needs: changes
|
|
||||||
if: github.repository == 'rust-lang/rust-analyzer'
|
if: github.repository == 'rust-lang/rust-analyzer'
|
||||||
name: proc-macro-srv
|
name: proc-macro-srv
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -72,7 +71,7 @@ jobs:
|
||||||
name: Rust
|
name: Rust
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
RUSTFLAGS: "-D warnings"
|
RUSTFLAGS: "-Dwarnings"
|
||||||
CC: deny_c
|
CC: deny_c
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -89,7 +88,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
rustup update --no-self-update stable
|
rustup update --no-self-update stable
|
||||||
rustup default 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
|
# We always use a nightly rustfmt, regardless of channel, because we need
|
||||||
# --file-lines.
|
# --file-lines.
|
||||||
rustup toolchain install nightly --profile minimal --component rustfmt
|
rustup toolchain install nightly --profile minimal --component rustfmt
|
||||||
|
|
@ -98,24 +97,24 @@ jobs:
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: echo "::add-matcher::.github/rust.json"
|
run: echo "::add-matcher::.github/rust.json"
|
||||||
|
|
||||||
- name: Cache Dependencies
|
|
||||||
uses: Swatinem/rust-cache@27b8ea9368cf428f0bfe41b0876b1a7e809d9844
|
|
||||||
with:
|
|
||||||
workspaces: |
|
|
||||||
. -> target
|
|
||||||
crates/proc-macro-srv/proc-macro-test/imp -> target
|
|
||||||
|
|
||||||
- uses: taiki-e/install-action@nextest
|
|
||||||
|
|
||||||
- name: Bump opt-level
|
- name: Bump opt-level
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
|
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
|
||||||
|
|
||||||
|
- name: Cache Dependencies
|
||||||
|
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
|
||||||
|
with:
|
||||||
|
workspaces: |
|
||||||
|
. -> target
|
||||||
|
./crates/proc-macro-srv/proc-macro-test/imp -> target
|
||||||
|
|
||||||
|
- uses: taiki-e/install-action@nextest
|
||||||
|
|
||||||
- name: Codegen checks (rust-analyzer)
|
- name: Codegen checks (rust-analyzer)
|
||||||
run: cargo codegen --check
|
run: cargo codegen --check
|
||||||
|
|
||||||
- name: Compile (tests)
|
- name: Compile (tests)
|
||||||
run: cargo test --no-run --locked
|
run: cargo test --no-run
|
||||||
|
|
||||||
# It's faster to `test` before `build` ¯\_(ツ)_/¯
|
# It's faster to `test` before `build` ¯\_(ツ)_/¯
|
||||||
- name: Compile (rust-analyzer)
|
- name: Compile (rust-analyzer)
|
||||||
|
|
@ -126,31 +125,53 @@ jobs:
|
||||||
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest' || github.event_name == 'push'
|
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
|
run: cargo nextest run --no-fail-fast --hide-progress-bar --status-level fail
|
||||||
|
|
||||||
- name: Switch to stable toolchain
|
|
||||||
run: |
|
|
||||||
rustup update --no-self-update stable
|
|
||||||
rustup component add --toolchain stable rust-src clippy
|
|
||||||
rustup default stable
|
|
||||||
|
|
||||||
- name: Run analysis-stats on rust-analyzer
|
|
||||||
if: matrix.os == 'ubuntu-latest'
|
|
||||||
run: target/${{ matrix.target }}/debug/rust-analyzer analysis-stats .
|
|
||||||
|
|
||||||
- name: Run analysis-stats on the rust standard libraries
|
|
||||||
if: matrix.os == 'ubuntu-latest'
|
|
||||||
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/
|
|
||||||
|
|
||||||
- name: clippy
|
- name: clippy
|
||||||
if: matrix.os == 'macos-latest'
|
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
|
run: cargo clippy --all-targets -- -D clippy::disallowed_macros -D clippy::dbg_macro -D clippy::todo -D clippy::print_stdout -D clippy::print_stderr
|
||||||
|
|
||||||
- name: rustfmt
|
analysis-stats:
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: github.repository == 'rust-lang/rust-analyzer'
|
||||||
run: cargo fmt -- --check
|
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 default stable
|
||||||
|
rustup component add rustfmt
|
||||||
|
|
||||||
|
- name: Cache Dependencies
|
||||||
|
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
|
||||||
|
|
||||||
|
- name: ./rust-analyzer
|
||||||
|
run: cargo run -p rust-analyzer -- analysis-stats . -q
|
||||||
|
|
||||||
|
- name: sysroot/lib/rustlib/src/rust/library/
|
||||||
|
env:
|
||||||
|
RUSTC_BOOTSTRAP: 1
|
||||||
|
run: cargo run -p rust-analyzer -- analysis-stats --with-deps --no-sysroot --no-test $(rustc --print sysroot)/lib/rustlib/src/rust/library/ -q
|
||||||
|
|
||||||
|
rustfmt:
|
||||||
|
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 default stable
|
||||||
|
rustup component add rustfmt
|
||||||
|
|
||||||
|
- run: cargo fmt -- --check
|
||||||
|
|
||||||
# Weird targets to catch non-portable code
|
|
||||||
miri:
|
miri:
|
||||||
if: github.repository == 'rust-lang/rust-analyzer'
|
if: github.repository == 'rust-lang/rust-analyzer'
|
||||||
name: miri
|
name: miri
|
||||||
|
|
@ -163,12 +184,13 @@ jobs:
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
run: |
|
run: |
|
||||||
rustup update --no-self-update nightly
|
rustup update --no-self-update nightly
|
||||||
rustup component add miri --toolchain nightly
|
rustup default nightly
|
||||||
|
rustup component add miri
|
||||||
|
|
||||||
- name: Cache Dependencies
|
- 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
|
# Weird targets to catch non-portable code
|
||||||
rust-cross:
|
rust-cross:
|
||||||
|
|
@ -193,7 +215,7 @@ jobs:
|
||||||
rustup target add ${{ env.targets }} ${{ env.targets_ide }}
|
rustup target add ${{ env.targets }} ${{ env.targets_ide }}
|
||||||
|
|
||||||
- name: Cache Dependencies
|
- name: Cache Dependencies
|
||||||
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
|
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
|
||||||
|
|
||||||
- name: Check
|
- name: Check
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue