1 # Please make sure that the `needs` fields for both `end-success` and `end-failure`
2 # are updated when adding new jobs!
17 RUSTFLAGS: "-D warnings -W unreachable-pub -W bare-trait-objects"
18 RUSTUP_MAX_RETRIES: 10
22 if: github.repository == 'rust-lang/rust-analyzer'
24 runs-on: ${{ matrix.os }}
31 os: [ubuntu-latest, windows-latest, macos-latest]
34 - name: Checkout repository
35 uses: actions/checkout@v3
37 ref: ${{ github.event.pull_request.head.sha }}
40 - name: Install Rust toolchain
42 rustup update --no-self-update stable
43 rustup component add rustfmt rust-src
45 - name: Cache Dependencies
46 uses: Swatinem/rust-cache@76686c56f2b581d1bb5bda44b51f7e24bd9b8b8e
48 - name: Bump opt-level
49 if: matrix.os == 'ubuntu-latest'
50 run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
52 - name: Compile (tests)
53 run: cargo test --no-run --locked
55 # It's faster to `test` before `build` ¯\_(ツ)_/¯
56 - name: Compile (rust-analyzer)
57 if: matrix.os == 'ubuntu-latest'
58 run: cargo build --quiet
61 run: cargo test -- --nocapture --quiet
63 - name: Run analysis-stats on rust-analyzer
64 if: matrix.os == 'ubuntu-latest'
65 run: target/${{ matrix.target }}/debug/rust-analyzer analysis-stats .
67 - name: Run analysis-stats on rust std library
68 if: matrix.os == 'ubuntu-latest'
69 run: target/${{ matrix.target }}/debug/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std
71 # Weird targets to catch non-portable code
73 if: github.repository == 'rust-lang/rust-analyzer'
75 runs-on: ubuntu-latest
78 targets: "powerpc-unknown-linux-gnu x86_64-unknown-linux-musl"
79 # The rust-analyzer binary is not expected to compile on WASM, but the IDE
81 targets_ide: "wasm32-unknown-unknown"
84 - name: Checkout repository
85 uses: actions/checkout@v3
87 - name: Install Rust toolchain
89 rustup update --no-self-update stable
90 rustup target add ${{ env.targets }} ${{ env.targets_ide }}
92 - name: Cache Dependencies
93 uses: Swatinem/rust-cache@76686c56f2b581d1bb5bda44b51f7e24bd9b8b8e
97 for target in ${{ env.targets }}; do
98 cargo check --target=$target --all-targets
100 for target in ${{ env.targets_ide }}; do
101 cargo check -p ide --target=$target --all-targets
105 if: github.repository == 'rust-lang/rust-analyzer'
110 os: [ubuntu-latest, windows-latest]
112 runs-on: ${{ matrix.os }}
115 - name: Checkout repository
116 uses: actions/checkout@v3
118 - name: Install Nodejs
119 uses: actions/setup-node@v3
124 if: matrix.os == 'ubuntu-latest'
125 run: sudo apt-get install -y xvfb
128 working-directory: ./editors/code
130 # - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
131 # if: runner.os == 'Linux'
132 # working-directory: ./editors/code
135 working-directory: ./editors/code
137 - name: Run VS Code tests (Linux)
138 if: matrix.os == 'ubuntu-latest'
141 run: xvfb-run npm test
142 working-directory: ./editors/code
144 - name: Run VS Code tests (Windows)
145 if: matrix.os == 'windows-latest'
149 working-directory: ./editors/code
151 - run: npm run pretest
152 working-directory: ./editors/code
154 - run: npm run package --scripts-prepend-node-path
155 working-directory: ./editors/code
158 name: bors build finished
159 if: github.event.pusher.name == 'bors' && success()
160 runs-on: ubuntu-latest
161 needs: [rust, rust-cross, typescript]
163 - name: Mark the job as successful
167 name: bors build finished
168 if: github.event.pusher.name == 'bors' && (failure() || cancelled())
169 runs-on: ubuntu-latest
170 needs: [rust, rust-cross, typescript]
172 - name: Mark the job as a failure