@@ -32,16 +32,21 @@ jobs:
32
32
filters : |
33
33
typescript:
34
34
- '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/**'
35
40
36
41
rust :
42
+ needs : changes
37
43
if : github.repository == 'rust-lang/rust-analyzer'
38
44
name : Rust
39
45
runs-on : ${{ matrix.os }}
40
46
env :
41
47
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' || ''}}"
45
50
46
51
strategy :
47
52
fail-fast : false
57
62
58
63
- name : Install Rust toolchain
59
64
run : |
60
- rustup update --no-self-update stable
65
+ rustup update --no-self-update ${{ env.RUST_CHANNEL }}
61
66
rustup component add rustfmt rust-src
62
67
63
68
- name : Cache Dependencies
@@ -68,15 +73,15 @@ jobs:
68
73
run : sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
69
74
70
75
- name : Compile (tests)
71
- run : cargo test --no-run --locked --features sysroot-abi
76
+ run : cargo test --no-run --locked ${{ env.USE_SYSROOT_ABI }}
72
77
73
78
# It's faster to `test` before `build` ¯\_(ツ)_/¯
74
79
- name : Compile (rust-analyzer)
75
80
if : matrix.os == 'ubuntu-latest'
76
- run : cargo build --quiet --features sysroot-abi
81
+ run : cargo build --quiet ${{ env.USE_SYSROOT_ABI }}
77
82
78
83
- name : Test
79
- run : cargo test --features sysroot-abi -- --nocapture --quiet
84
+ run : cargo test ${{ env.USE_SYSROOT_ABI }} -- --nocapture --quiet
80
85
81
86
- name : Run analysis-stats on rust-analyzer
82
87
if : matrix.os == 'ubuntu-latest'
0 commit comments