rust/.github/workflows/ci.yaml

99 lines
2.6 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
2020-01-07 10:50:24 -06:00
RUSTUP_MAX_RETRIES: 10
CARGO_NET_RETRY: 10
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
# 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 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
2020-01-07 10:36:09 -06: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 16:26:54 -06:00
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
- name: Prepare cache
run: cargo xtask pre-cache
2019-11-18 02:13:31 -06:00
- name: Prepare cache 2
2020-01-02 08:54:44 -06:00
if: matrix.os == 'windows-latest'
2020-01-11 14:38:15 -06:00
run: Remove-Item ./target/debug/xtask.exe
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