Files
tokenizers/.github/workflows/rust.yml
Evan Pete Walsh d1ae0bd576 Cache cargo registry and build target directory in CI (#78)
* try caching cargo registry and build

* trigger build

* try fixing path

* force build

* try different cache key

* try rebuild
2020-01-17 13:30:08 -08:00

63 lines
1.7 KiB
YAML

name: Rust
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
override: true
- name: Cache Cargo Registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
- name: Cache Cargo Build Target
uses: actions/cache@v1
with:
path: tokenizers/target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.toml') }}
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets --verbose --manifest-path ./tokenizers/Cargo.toml
- name: Lint with RustFmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./tokenizers/Cargo.toml -- --check
- name: Lint Benchmarks with RustFmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./tokenizers/Cargo.toml -- ./tokenizers/benches/bpe_benchmark.rs --check
- name: Lint with Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --manifest-path ./tokenizers/Cargo.toml --all-targets --all-features -- -D warnings
- name: Run Tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --manifest-path ./tokenizers/Cargo.toml