AppFlowy/.github/workflows/rust_test.yml

51 lines
1.3 KiB
YAML
Raw Normal View History

2022-02-10 01:15:16 +00:00
name: Unit test(Rust)
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
env:
CARGO_TERM_COLOR: always
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- id: rust_toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 'stable-2022-01-20'
- name: Cache Cargo
uses: actions/cache@v2
with:
path: |
~/.cargo
key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
- name: Cache Rust
uses: actions/cache@v2
with:
path: |
frontend/rust-lib/target
shared-lib/target
key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
2022-02-09 13:13:51 +00:00
- name: Install cargo-make
working-directory: frontend
run: cargo install cargo-make
- name: Run rust-lib tests
2022-02-09 12:56:29 +00:00
working-directory: frontend/rust-lib
2022-04-17 12:50:16 +00:00
run: RUST_LOG=info cargo test --no-default-features --features="sync"
- name: Run shared-lib tests
2022-02-09 12:56:29 +00:00
working-directory: shared-lib
2022-04-12 03:13:35 +00:00
run: RUST_LOG=info cargo test --no-default-features