MeiliSearch/.github/workflows/rust.yml

87 lines
2.0 KiB
YAML
Raw Normal View History

2021-02-24 10:31:28 +01:00
name: Rust
2021-03-16 10:26:08 +01:00
on:
2021-05-11 12:18:10 +02:00
workflow_dispatch:
2021-03-16 10:26:08 +01:00
pull_request:
push:
# trying and staging branches are for Bors config
branches:
- trying
- staging
2021-02-24 10:31:28 +01:00
env:
CARGO_TERM_COLOR: always
jobs:
2021-03-16 10:26:08 +01:00
tests:
name: Tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
2021-07-01 11:25:33 +02:00
os: [ubuntu-18.04, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
2021-07-07 17:07:20 +02:00
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo
./target
key: ${{ matrix.os }}-${{ hashFiles('Cargo.lock') }}
2021-04-27 12:36:36 +02:00
- name: Run cargo check without any default features
uses: actions-rs/cargo@v1
with:
2021-04-29 15:19:48 +02:00
command: build
args: --locked --release --no-default-features
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --release
2021-02-24 10:31:28 +01:00
clippy:
name: Run Clippy
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
2021-07-07 17:07:20 +02:00
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo
./target
key: ${{ matrix.os }}-${{ hashFiles('Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- --deny warnings
fmt:
name: Run Rustfmt
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
2021-07-07 17:07:20 +02:00
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo
./target
key: ${{ matrix.os }}-${{ hashFiles('Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check