@@ -32,16 +32,21 @@ jobs:
3232 filters : |
3333 typescript:
3434 - 'editors/code/**'
35+ proc_macros:
36+ - 'crates/proc-macro-api/**'
37+ - 'crates/proc-macro-srv/**'
38+ - 'crates/proc-macro-srv-cli/**'
39+ - 'crates/proc-macro-test/**'
3540
3641 rust :
42+ needs : changes
3743 if : github.repository == 'rust-lang/rust-analyzer'
3844 name : Rust
3945 runs-on : ${{ matrix.os }}
4046 env :
4147 CC : deny_c
42- # we want to build r-a on stable to check that it keeps building on stable,
43- # but we also want to test our proc-macro-srv which depends on nightly features
44- RUSTC_BOOTSTRAP : 1
48+ RUST_CHANNEL : " ${{ needs.changes.outputs.proc_macros == 'true' && 'nightly' || 'stable'}}"
49+ USE_SYSROOT_ABI : " ${{ needs.changes.outputs.proc_macros == 'true' && '--features sysroot-abi' || ''}}"
4550
4651 strategy :
4752 fail-fast : false
5762
5863 - name : Install Rust toolchain
5964 run : |
60- rustup update --no-self-update stable
65+ rustup update --no-self-update ${{ env.RUST_CHANNEL }}
6166 rustup component add rustfmt rust-src
6267
6368 - name : Cache Dependencies
@@ -68,15 +73,15 @@ jobs:
6873 run : sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
6974
7075 - name : Compile (tests)
71- run : cargo test --no-run --locked --features sysroot-abi
76+ run : cargo test --no-run --locked ${{ env.USE_SYSROOT_ABI }}
7277
7378 # It's faster to `test` before `build` ¯\_(ツ)_/¯
7479 - name : Compile (rust-analyzer)
7580 if : matrix.os == 'ubuntu-latest'
76- run : cargo build --quiet --features sysroot-abi
81+ run : cargo build --quiet ${{ env.USE_SYSROOT_ABI }}
7782
7883 - name : Test
79- run : cargo test --features sysroot-abi -- --nocapture --quiet
84+ run : cargo test ${{ env.USE_SYSROOT_ABI }} -- --nocapture --quiet
8085
8186 - name : Run analysis-stats on rust-analyzer
8287 if : matrix.os == 'ubuntu-latest'
0 commit comments