15 RUSTFLAGS: "-D warnings -W unreachable-pub -W rust-2021-compatibility"
16 RUSTUP_MAX_RETRIES: 10
20 if: github.repository == 'rust-analyzer/rust-analyzer'
22 runs-on: ${{ matrix.os }}
29 os: [ubuntu-latest, windows-latest, macos-latest]
32 - name: Checkout repository
33 uses: actions/checkout@v2
35 ref: ${{ github.event.pull_request.head.sha }}
38 # We need to disable the existing toolchain to avoid updating rust-docs
39 # which takes a long time. The fastest way to do this is to rename the
40 # existing folder, as deleting it takes about as much time as not doing
41 # anything and just updating rust-docs.
42 - name: Rename existing rust toolchain (Windows)
43 if: matrix.os == 'windows-latest'
44 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
46 - name: Install Rust toolchain
47 uses: actions-rs/toolchain@v1
52 components: rustfmt, rust-src
54 - name: Cache Dependencies
55 uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
58 run: cargo test --no-run --locked
61 run: cargo test -- --nocapture --quiet
63 # Weird targets to catch non-portable code
65 if: github.repository == 'rust-analyzer/rust-analyzer'
67 runs-on: ubuntu-latest
70 targets: "powerpc-unknown-linux-gnu x86_64-unknown-linux-musl"
71 # The rust-analyzer binary is not expected to compile on WASM, but the IDE
73 targets_ide: "wasm32-unknown-unknown"
76 - name: Checkout repository
77 uses: actions/checkout@v2
79 - name: Install Rust toolchain
80 uses: actions-rs/toolchain@v1
86 - name: Install Rust targets
87 run: rustup target add ${{ env.targets }} ${{ env.targets_ide }}
89 - name: Cache Dependencies
90 uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
94 for target in ${{ env.targets }}; do
95 cargo check --target=$target --all-targets
97 for target in ${{ env.targets_ide }}; do
98 cargo check -p ide --target=$target --all-targets
102 if: github.repository == 'rust-analyzer/rust-analyzer'
107 os: [ubuntu-latest, windows-latest]
109 runs-on: ${{ matrix.os }}
112 - name: Checkout repository
113 uses: actions/checkout@v2
115 - name: Install Nodejs
116 uses: actions/setup-node@v1
121 if: matrix.os == 'ubuntu-latest'
122 run: sudo apt-get install -y xvfb
125 working-directory: ./editors/code
127 # - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
128 # if: runner.os == 'Linux'
129 # working-directory: ./editors/code
132 working-directory: ./editors/code
134 - name: Run VS Code tests (Linux)
135 if: matrix.os == 'ubuntu-latest'
138 run: xvfb-run npm test
139 working-directory: ./editors/code
141 - name: Run VS Code tests (Windows)
142 if: matrix.os == 'windows-latest'
146 working-directory: ./editors/code
148 - run: npm run pretest
149 working-directory: ./editors/code
151 - run: npm run package --scripts-prepend-node-path
152 working-directory: ./editors/code