fork/rust-analyzer
git clone https://git.julia.blue/fork/rust-analyzer
3eb8b28ce5
2022-07-04
1# Please make sure that the `needs` fields for both `end-success` and `end-failure` 2# are updated when adding new jobs! 3 4name : CI 5on : 6pull_request : 7push : 8branches : 9- auto 10- try 11 12env : 13CARGO_INCREMENTAL : 0 14CARGO_NET_RETRY : 10 15CI : 1 16RUST_BACKTRACE : short 17RUSTFLAGS : "-D warnings -W unreachable-pub -W rust-2021-compatibility" 18RUSTUP_MAX_RETRIES : 10 19 20jobs : 21rust : 22if : github.repository == 'rust-lang/rust-analyzer' 23name : Rust 24runs-on : ${{ matrix.os }} 25env : 26CC : deny_c 27 28strategy : 29fail-fast : false 30matrix : 31os : [ ubuntu-latest , windows-latest , macos-latest ] 32 33steps : 34- name : Checkout repository 35uses : actions/checkout@v3 36with : 37ref : ${{ github.event.pull_request.head.sha }} 38fetch-depth : 20 39 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) 45if : matrix.os == 'windows-latest' 46run : 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 47 48- name : Install Rust toolchain 49uses : actions-rs/toolchain@v1 50with : 51toolchain : stable 52profile : minimal 53override : true 54components : rustfmt, rust-src 55 56- name : Cache Dependencies 57uses : Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72 58 59- name : Compile 60run : cargo test --no-run --locked 61 62- name : Test 63run : cargo test -- --nocapture --quiet 64 65# Weird targets to catch non-portable code 66rust-cross : 67if : github.repository == 'rust-lang/rust-analyzer' 68name : Rust Cross 69runs-on : ubuntu-latest 70 71env : 72targets : "powerpc-unknown-linux-gnu x86_64-unknown-linux-musl" 73# The rust-analyzer binary is not expected to compile on WASM, but the IDE 74# crate should 75targets_ide : "wasm32-unknown-unknown" 76 77steps : 78- name : Checkout repository 79uses : actions/checkout@v3 80 81- name : Install Rust toolchain 82uses : actions-rs/toolchain@v1 83with : 84toolchain : stable 85profile : minimal 86override : true 87 88- name : Install Rust targets 89run : rustup target add ${{ env.targets }} ${{ env.targets_ide }} 90 91- name : Cache Dependencies 92uses : Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72 93 94- name : Check 95run : | 96for target in ${{ env.targets }}; do 97cargo check --target=$target --all-targets 98done 99for target in ${{ env.targets_ide }}; do 100cargo check -p ide --target=$target --all-targets 101done 102 103typescript : 104if : github.repository == 'rust-lang/rust-analyzer' 105name : TypeScript 106strategy : 107fail-fast : false 108matrix : 109os : [ ubuntu-latest , windows-latest ] 110 111runs-on : ${{ matrix.os }} 112 113steps : 114- name : Checkout repository 115uses : actions/checkout@v3 116 117- name : Install Nodejs 118uses : actions/setup-node@v1 119with : 120node-version : 14.x 121 122- name : Install xvfb 123if : matrix.os == 'ubuntu-latest' 124run : sudo apt-get install -y xvfb 125 126- run : npm ci 127working-directory : ./editors/code 128 129# - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; } 130# if: runner.os == 'Linux' 131# working-directory: ./editors/code 132 133- run : npm run lint 134working-directory : ./editors/code 135 136- name : Run VS Code tests (Linux) 137if : matrix.os == 'ubuntu-latest' 138env : 139VSCODE_CLI : 1 140run : xvfb-run npm test 141working-directory : ./editors/code 142 143- name : Run VS Code tests (Windows) 144if : matrix.os == 'windows-latest' 145env : 146VSCODE_CLI : 1 147run : npm test 148working-directory : ./editors/code 149 150- run : npm run pretest 151working-directory : ./editors/code 152 153- run : npm run package --scripts-prepend-node-path 154working-directory : ./editors/code 155 156end-success : 157name : bors build finished 158if : github.event.pusher.name == 'bors' && success() 159runs-on : ubuntu-latest 160needs : [ rust , rust-cross , typescript ] 161steps : 162- name : Mark the job as successful 163run : exit 0 164 165end-failure : 166name : bors build finished 167if : github.event.pusher.name == 'bors' && (failure() || cancelled()) 168runs-on : ubuntu-latest 169needs : [ rust , rust-cross , typescript ] 170steps : 171- name : Mark the job as a failure 172run : exit 1