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 rust-2021-compatibility"
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@v2
37 ref: ${{ github.event.pull_request.head.sha }}
40 # We need to disable the existing toolchain to avoid updating rust-docs
41 # which takes a long time. The fastest way to do this is to rename the
42 # existing folder, as deleting it takes about as much time as not doing
43 # anything and just updating rust-docs.
44 - name: Rename existing rust toolchain (Windows)
45 if: matrix.os == 'windows-latest'
46 run: Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old
48 - name: Install Rust toolchain
49 uses: actions-rs/toolchain@v1
54 components: rustfmt, rust-src
56 - name: Cache Dependencies
57 uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
60 run: cargo test --no-run --locked
63 run: cargo test -- --nocapture --quiet
65 # Weird targets to catch non-portable code
67 if: github.repository == 'rust-lang/rust-analyzer'
69 runs-on: ubuntu-latest
72 targets: "powerpc-unknown-linux-gnu x86_64-unknown-linux-musl"
73 # The rust-analyzer binary is not expected to compile on WASM, but the IDE
75 targets_ide: "wasm32-unknown-unknown"
78 - name: Checkout repository
79 uses: actions/checkout@v2
81 - name: Install Rust toolchain
82 uses: actions-rs/toolchain@v1
88 - name: Install Rust targets
89 run: rustup target add ${{ env.targets }} ${{ env.targets_ide }}
91 - name: Cache Dependencies
92 uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
96 for target in ${{ env.targets }}; do
97 cargo check --target=$target --all-targets
99 for target in ${{ env.targets_ide }}; do
100 cargo check -p ide --target=$target --all-targets
104 if: github.repository == 'rust-lang/rust-analyzer'
109 os: [ubuntu-latest, windows-latest]
111 runs-on: ${{ matrix.os }}
114 - name: Checkout repository
115 uses: actions/checkout@v2
117 - name: Install Nodejs
118 uses: actions/setup-node@v1
123 if: matrix.os == 'ubuntu-latest'
124 run: sudo apt-get install -y xvfb
127 working-directory: ./editors/code
129 # - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
130 # if: runner.os == 'Linux'
131 # working-directory: ./editors/code
134 working-directory: ./editors/code
136 - name: Run VS Code tests (Linux)
137 if: matrix.os == 'ubuntu-latest'
140 run: xvfb-run npm test
141 working-directory: ./editors/code
143 - name: Run VS Code tests (Windows)
144 if: matrix.os == 'windows-latest'
148 working-directory: ./editors/code
150 - run: npm run pretest
151 working-directory: ./editors/code
153 - run: npm run package --scripts-prepend-node-path
154 working-directory: ./editors/code
157 name: bors build finished
158 if: github.event.pusher.name == 'bors' && success()
159 runs-on: ubuntu-latest
160 needs: [rust, rust-cross, typescript]
162 - name: Mark the job as successful
166 name: bors build finished
167 if: github.event.pusher.name == 'bors' && (failure() || cancelled())
168 runs-on: ubuntu-latest
169 needs: [rust, rust-cross, typescript]
171 - name: Mark the job as a failure