rust/.github/workflows/ci.yaml

97 lines
2.9 KiB
YAML
Raw Normal View History

2019-11-18 02:13:31 -06:00
name: CI
on:
pull_request:
push:
branches:
- master
- staging
2019-11-18 10:33:55 -06:00
- trying
2019-11-16 16:26:54 -06:00
jobs:
2019-11-18 02:13:31 -06:00
rust:
name: Rust
2020-01-02 08:08:36 -06:00
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
2019-11-16 16:26:54 -06:00
env:
RUSTFLAGS: -D warnings
CARGO_INCREMENTAL: 0
2019-12-07 05:46:36 -06:00
RUN_SLOW_TESTS: 1
2019-11-16 16:26:54 -06:00
steps:
2019-11-18 02:13:31 -06:00
2019-11-16 16:26:54 -06:00
- name: Checkout repository
uses: actions/checkout@v1
2019-11-18 02:13:31 -06:00
- name: Cleanup Rust components (Windows)
if: matrix.os == 'windows-latest'
run: rustup component remove rust-docs
2019-11-16 16:26:54 -06:00
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt, rust-src
2019-11-18 02:13:31 -06:00
2019-11-16 16:26:54 -06:00
- name: Cargo target cache
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
2019-11-18 02:13:31 -06:00
2019-11-16 16:26:54 -06:00
- name: Compile
uses: actions-rs/cargo@v1
with:
command: test
args: --no-run
2019-11-18 02:13:31 -06:00
2019-11-16 16:26:54 -06:00
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
2019-11-18 02:13:31 -06:00
2020-01-02 08:54:44 -06:00
- name: Prepare build directory for cache (UNIX)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
2019-11-16 16:26:54 -06:00
run: |
2019-12-07 05:46:36 -06:00
find ./target/debug -maxdepth 1 -type f -delete \
&& rm -fr ./target/debug/{deps,.fingerprint}/{*ra_*,*heavy_test*,*gen_lsp*,*thread_worker*} \
&& rm -f ./target/.rustc_info.json \
&& rm ./target/.slow_tests_cookie
2019-11-18 02:13:31 -06:00
2020-01-02 08:54:44 -06:00
- name: Prepare build directory for cache (Windows)
if: matrix.os == 'windows-latest'
run: >-
(Get-ChildItem ./target/debug -Recurse -Depth 1 -File | Remove-Item) -and
(Remove-Item -Force -Recurse ./target/debug/deps/*ra_*) -and
(Remove-Item -Force -Recurse ./target/debug/deps/*heavy_test*) -and
(Remove-Item -Force -Recurse ./target/debug/deps/*gen_lsp*) -and
(Remove-Item -Force -Recurse ./target/debug/deps/*thread_worker*) -and
(Remove-Item -Force -Recurse ./target/debug/.fingerprint/*ra_*) -and
(Remove-Item -Force -Recurse ./target/debug/.fingerprint/*heavy_test*) -and
(Remove-Item -Force -Recurse ./target/debug/.fingerprint/*gen_lsp*) -and
(Remove-Item -Force -Recurse ./target/debug/.fingerprint/*thread_worker*) -and
(Remove-Item -Force ./target/.rustc_info.json) -and
(Remove-Item ./target/.slow_tests_cookie)
2019-11-18 02:13:31 -06:00
type-script:
name: TypeScript
2019-11-16 16:26:54 -06: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 02:13:31 -06:00
2019-11-16 16:26:54 -06:00
- name: Install Nodejs
uses: actions/setup-node@v1
with:
node-version: 12.x
2019-11-18 02:13:31 -06:00
2019-11-16 16:26:54 -06:00
- run: npm ci
working-directory: ./editors/code
2019-12-30 04:23:38 -06:00
- run: npm run package --scripts-prepend-node-path
2019-11-16 16:26:54 -06:00
working-directory: ./editors/code