mirror of
https://github.com/microsoft/edit.git
synced 2026-02-05 12:17:53 -06:00
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- windows-latest
|
|
steps:
|
|
# The Windows runners have autocrlf enabled by default.
|
|
- name: Disable git autocrlf
|
|
run: git config --global core.autocrlf false
|
|
if: matrix.os == 'windows-latest'
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
# https://github.com/actions/cache/blob/main/examples.md#rust---cargo
|
|
# Depends on `Cargo.lock` --> Has to be after checkout.
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
target/
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
- name: Install Rust
|
|
run: rustup toolchain install nightly --no-self-update --profile minimal --component rust-src,rustfmt,clippy
|
|
- name: Check formatting
|
|
run: cargo fmt --all -- --check
|
|
- name: Run tests
|
|
run: cargo test --all-features --all-targets
|
|
- name: Run clippy
|
|
run: cargo clippy --all-features --all-targets -- --no-deps --deny warnings
|