fork/rust-analyzer
git clone https://git.julia.blue/fork/rust-analyzer
f2c2c36efe
2022-07-18
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- name : Install Rust toolchain 41run : | 42rustup update --no-self-update stable 43rustup component add rustfmt rust-src 44 45- name : Cache Dependencies 46uses : Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72 47 48- name : Compile 49run : cargo test --no-run --locked 50 51- name : Test 52run : cargo test -- --nocapture --quiet 53 54# Weird targets to catch non-portable code 55rust-cross : 56if : github.repository == 'rust-lang/rust-analyzer' 57name : Rust Cross 58runs-on : ubuntu-latest 59 60env : 61targets : "powerpc-unknown-linux-gnu x86_64-unknown-linux-musl" 62# The rust-analyzer binary is not expected to compile on WASM, but the IDE 63# crate should 64targets_ide : "wasm32-unknown-unknown" 65 66steps : 67- name : Checkout repository 68uses : actions/checkout@v3 69 70- name : Install Rust toolchain 71run : | 72rustup update --no-self-update stable 73rustup target add ${{ env.targets }} ${{ env.targets_ide }} 74 75- name : Cache Dependencies 76uses : Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72 77 78- name : Check 79run : | 80for target in ${{ env.targets }}; do 81cargo check --target=$target --all-targets 82done 83for target in ${{ env.targets_ide }}; do 84cargo check -p ide --target=$target --all-targets 85done 86 87typescript : 88if : github.repository == 'rust-lang/rust-analyzer' 89name : TypeScript 90strategy : 91fail-fast : false 92matrix : 93os : [ ubuntu-latest , windows-latest ] 94 95runs-on : ${{ matrix.os }} 96 97steps : 98- name : Checkout repository 99uses : actions/checkout@v3 100 101- name : Install Nodejs 102uses : actions/setup-node@v1 103with : 104node-version : 14.x 105 106- name : Install xvfb 107if : matrix.os == 'ubuntu-latest' 108run : sudo apt-get install -y xvfb 109 110- run : npm ci 111working-directory : ./editors/code 112 113# - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; } 114# if: runner.os == 'Linux' 115# working-directory: ./editors/code 116 117- run : npm run lint 118working-directory : ./editors/code 119 120- name : Run VS Code tests (Linux) 121if : matrix.os == 'ubuntu-latest' 122env : 123VSCODE_CLI : 1 124run : xvfb-run npm test 125working-directory : ./editors/code 126 127- name : Run VS Code tests (Windows) 128if : matrix.os == 'windows-latest' 129env : 130VSCODE_CLI : 1 131run : npm test 132working-directory : ./editors/code 133 134- run : npm run pretest 135working-directory : ./editors/code 136 137- run : npm run package --scripts-prepend-node-path 138working-directory : ./editors/code 139 140end-success : 141name : bors build finished 142if : github.event.pusher.name == 'bors' && success() 143runs-on : ubuntu-latest 144needs : [ rust , rust-cross , typescript ] 145steps : 146- name : Mark the job as successful 147run : exit 0 148 149end-failure : 150name : bors build finished 151if : github.event.pusher.name == 'bors' && (failure() || cancelled()) 152runs-on : ubuntu-latest 153needs : [ rust , rust-cross , typescript ] 154steps : 155- name : Mark the job as a failure 156run : exit 1