rust-analyzer/.github/workflows/ci.yaml

100 lines
2.6 KiB
YAML
Raw Normal View History

2019-11-18 08:13:31 +00:00
name: CI
on:
pull_request:
push:
branches:
- master
- staging
2019-11-18 16:33:55 +00:00
- trying
2019-11-16 22:26:54 +00:00
jobs:
2019-11-18 08:13:31 +00:00
rust:
name: Rust
2020-01-02 14:08:36 +00:00
runs-on: ${{ matrix.os }}
strategy:
2020-01-22 10:53:47 +00:00
fail-fast: false
2020-01-02 14:08:36 +00:00
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
2019-11-16 22:26:54 +00:00
env:
RUSTFLAGS: -D warnings
CARGO_INCREMENTAL: 0
2019-12-07 11:46:36 +00:00
RUN_SLOW_TESTS: 1
2020-01-07 16:50:24 +00:00
RUSTUP_MAX_RETRIES: 10
CARGO_NET_RETRY: 10
2019-11-16 22:26:54 +00:00
steps:
2019-11-18 08:13:31 +00:00
2019-11-16 22:26:54 +00:00
- name: Checkout repository
uses: actions/checkout@v1
2019-11-18 08:13:31 +00:00
# We need to disable the existing toolchain to avoid updating rust-docs
# which takes a long time. The fastest way to do this is to rename the
# existing folder, as deleting it takes about as much time as not doing
# anything and just updating rust-docs.
- name: Rename existing rust toolchain (Windows)
if: matrix.os == 'windows-latest'
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
2019-11-16 22:26:54 +00:00
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt, rust-src
2019-11-18 08:13:31 +00:00
2020-01-07 16:36:09 +00:00
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo target dir
2019-11-16 22:26:54 +00:00
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
2019-11-18 08:13:31 +00:00
2019-11-16 22:26:54 +00:00
- name: Compile
uses: actions-rs/cargo@v1
with:
command: test
args: --no-run
2019-11-18 08:13:31 +00:00
2019-11-16 22:26:54 +00:00
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
2019-11-18 08:13:31 +00:00
- name: Prepare cache
run: cargo xtask pre-cache
2019-11-18 08:13:31 +00:00
- name: Prepare cache 2
2020-01-02 14:54:44 +00:00
if: matrix.os == 'windows-latest'
2020-01-11 20:38:15 +00:00
run: Remove-Item ./target/debug/xtask.exe
2019-11-18 08:13:31 +00:00
type-script:
name: TypeScript
2019-11-16 22:26:54 +00:00
runs-on: ubuntu-latest
env:
CXX: g++-4.9
CC: gcc-4.9
steps:
- name: Checkout repository
uses: actions/checkout@v1
2019-11-18 08:13:31 +00:00
2019-11-16 22:26:54 +00:00
- name: Install Nodejs
uses: actions/setup-node@v1
with:
node-version: 12.x
2019-11-18 08:13:31 +00:00
2019-11-16 22:26:54 +00:00
- run: npm ci
working-directory: ./editors/code
2019-12-30 10:23:38 +00:00
- run: npm run package --scripts-prepend-node-path
2019-11-16 22:26:54 +00:00
working-directory: ./editors/code