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
41 run: rustup update stable && rustup component add rustfmt rust-src
43 - name: Cache Dependencies
44 uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
47 run: cargo test --no-run --locked
50 run: cargo test -- --nocapture --quiet
52 # Weird targets to catch non-portable code
54 if: github.repository == 'rust-lang/rust-analyzer'
56 runs-on: ubuntu-latest
59 targets: "powerpc-unknown-linux-gnu x86_64-unknown-linux-musl"
60 # The rust-analyzer binary is not expected to compile on WASM, but the IDE
62 targets_ide: "wasm32-unknown-unknown"
65 - name: Checkout repository
66 uses: actions/checkout@v3
68 - name: Install Rust toolchain
69 run: rustup update stable
71 - name: Install Rust targets
72 run: rustup target add ${{ env.targets }} ${{ env.targets_ide }}
74 - name: Cache Dependencies
75 uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
79 for target in ${{ env.targets }}; do
80 cargo check --target=$target --all-targets
82 for target in ${{ env.targets_ide }}; do
83 cargo check -p ide --target=$target --all-targets
87 if: github.repository == 'rust-lang/rust-analyzer'
92 os: [ubuntu-latest, windows-latest]
94 runs-on: ${{ matrix.os }}
97 - name: Checkout repository
98 uses: actions/checkout@v3
100 - name: Install Nodejs
101 uses: actions/setup-node@v1
106 if: matrix.os == 'ubuntu-latest'
107 run: sudo apt-get install -y xvfb
110 working-directory: ./editors/code
112 # - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
113 # if: runner.os == 'Linux'
114 # working-directory: ./editors/code
117 working-directory: ./editors/code
119 - name: Run VS Code tests (Linux)
120 if: matrix.os == 'ubuntu-latest'
123 run: xvfb-run npm test
124 working-directory: ./editors/code
126 - name: Run VS Code tests (Windows)
127 if: matrix.os == 'windows-latest'
131 working-directory: ./editors/code
133 - run: npm run pretest
134 working-directory: ./editors/code
136 - run: npm run package --scripts-prepend-node-path
137 working-directory: ./editors/code
140 name: bors build finished
141 if: github.event.pusher.name == 'bors' && success()
142 runs-on: ubuntu-latest
143 needs: [rust, rust-cross, typescript]
145 - name: Mark the job as successful
149 name: bors build finished
150 if: github.event.pusher.name == 'bors' && (failure() || cancelled())
151 runs-on: ubuntu-latest
152 needs: [rust, rust-cross, typescript]
154 - name: Mark the job as a failure