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@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@ce325b60658c1b38465c06cc965b79baf32c1e72
49 run: cargo test --no-run --locked
52 run: cargo test -- --nocapture --quiet
54 # Weird targets to catch non-portable code
56 if: github.repository == 'rust-lang/rust-analyzer'
58 runs-on: ubuntu-latest
61 targets: "powerpc-unknown-linux-gnu x86_64-unknown-linux-musl"
62 # The rust-analyzer binary is not expected to compile on WASM, but the IDE
64 targets_ide: "wasm32-unknown-unknown"
67 - name: Checkout repository
68 uses: actions/checkout@v3
70 - name: Install Rust toolchain
72 rustup update --no-self-update stable
73 rustup target add ${{ env.targets }} ${{ env.targets_ide }}
75 - name: Cache Dependencies
76 uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
80 for target in ${{ env.targets }}; do
81 cargo check --target=$target --all-targets
83 for target in ${{ env.targets_ide }}; do
84 cargo check -p ide --target=$target --all-targets
88 if: github.repository == 'rust-lang/rust-analyzer'
93 os: [ubuntu-latest, windows-latest]
95 runs-on: ${{ matrix.os }}
98 - name: Checkout repository
99 uses: actions/checkout@v3
101 - name: Install Nodejs
102 uses: actions/setup-node@v1
107 if: matrix.os == 'ubuntu-latest'
108 run: sudo apt-get install -y xvfb
111 working-directory: ./editors/code
113 # - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
114 # if: runner.os == 'Linux'
115 # working-directory: ./editors/code
118 working-directory: ./editors/code
120 - name: Run VS Code tests (Linux)
121 if: matrix.os == 'ubuntu-latest'
124 run: xvfb-run npm test
125 working-directory: ./editors/code
127 - name: Run VS Code tests (Windows)
128 if: matrix.os == 'windows-latest'
132 working-directory: ./editors/code
134 - run: npm run pretest
135 working-directory: ./editors/code
137 - run: npm run package --scripts-prepend-node-path
138 working-directory: ./editors/code
141 name: bors build finished
142 if: github.event.pusher.name == 'bors' && success()
143 runs-on: ubuntu-latest
144 needs: [rust, rust-cross, typescript]
146 - name: Mark the job as successful
150 name: bors build finished
151 if: github.event.pusher.name == 'bors' && (failure() || cancelled())
152 runs-on: ubuntu-latest
153 needs: [rust, rust-cross, typescript]
155 - name: Mark the job as a failure