1 # Please make sure that the `needs` fields for both `end-success` and `end-failure`
2 # are updated when adding new jobs!
20 RUSTFLAGS: "-D warnings -W unreachable-pub -W rust-2021-compatibility"
21 RUSTUP_MAX_RETRIES: 10
25 if: github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer'
27 runs-on: ${{ matrix.os }}
34 os: [ubuntu-latest, windows-latest, macos-latest]
37 - name: Checkout repository
38 uses: actions/checkout@v2
40 ref: ${{ github.event.pull_request.head.sha }}
43 # We need to disable the existing toolchain to avoid updating rust-docs
44 # which takes a long time. The fastest way to do this is to rename the
45 # existing folder, as deleting it takes about as much time as not doing
46 # anything and just updating rust-docs.
47 - name: Rename existing rust toolchain (Windows)
48 if: matrix.os == 'windows-latest'
49 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
51 - name: Install Rust toolchain
52 uses: actions-rs/toolchain@v1
57 components: rustfmt, rust-src
59 - name: Cache Dependencies
60 uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
63 run: cargo test --no-run --locked
66 run: cargo test -- --nocapture --quiet
68 # Weird targets to catch non-portable code
70 if: github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer'
72 runs-on: ubuntu-latest
75 targets: "powerpc-unknown-linux-gnu x86_64-unknown-linux-musl"
76 # The rust-analyzer binary is not expected to compile on WASM, but the IDE
78 targets_ide: "wasm32-unknown-unknown"
81 - name: Checkout repository
82 uses: actions/checkout@v2
84 - name: Install Rust toolchain
85 uses: actions-rs/toolchain@v1
91 - name: Install Rust targets
92 run: rustup target add ${{ env.targets }} ${{ env.targets_ide }}
94 - name: Cache Dependencies
95 uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
99 for target in ${{ env.targets }}; do
100 cargo check --target=$target --all-targets
102 for target in ${{ env.targets_ide }}; do
103 cargo check -p ide --target=$target --all-targets
107 if: github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer'
112 os: [ubuntu-latest, windows-latest]
114 runs-on: ${{ matrix.os }}
117 - name: Checkout repository
118 uses: actions/checkout@v2
120 - name: Install Nodejs
121 uses: actions/setup-node@v1
126 if: matrix.os == 'ubuntu-latest'
127 run: sudo apt-get install -y xvfb
130 working-directory: ./editors/code
132 # - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
133 # if: runner.os == 'Linux'
134 # working-directory: ./editors/code
137 working-directory: ./editors/code
139 - name: Run VS Code tests (Linux)
140 if: matrix.os == 'ubuntu-latest'
143 run: xvfb-run npm test
144 working-directory: ./editors/code
146 - name: Run VS Code tests (Windows)
147 if: matrix.os == 'windows-latest'
151 working-directory: ./editors/code
153 - run: npm run pretest
154 working-directory: ./editors/code
156 - run: npm run package --scripts-prepend-node-path
157 working-directory: ./editors/code
160 name: bors build finished
161 if: github.event.pusher.name == 'bors' && success()
162 runs-on: ubuntu-latest
163 needs: [rust, rust-cross, typescript]
165 - name: Mark the job as successful
169 name: bors build finished
170 if: github.event.pusher.name == 'bors' && (failure() || cancelled())
171 runs-on: ubuntu-latest
172 needs: [rust, rust-cross, typescript]
174 - name: Mark the job as a failure