mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
59 lines
1.5 KiB
YAML
59 lines
1.5 KiB
YAML
name: Backend test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
paths:
|
|
- "frontend/rust-lib/**"
|
|
- "shared-lib/**"
|
|
|
|
pull_request:
|
|
branches:
|
|
- "main"
|
|
paths:
|
|
- "frontend/rust-lib/**"
|
|
- "shared-lib/**"
|
|
|
|
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-04-07'
|
|
|
|
- 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') }}
|
|
|
|
- name: Install cargo-make
|
|
working-directory: frontend
|
|
run: cargo install cargo-make
|
|
|
|
- name: Run rust-lib tests
|
|
working-directory: frontend/rust-lib
|
|
run: RUST_LOG=info cargo test --no-default-features --features="sync"
|
|
|
|
- name: Run shared-lib tests
|
|
working-directory: shared-lib
|
|
run: RUST_LOG=info cargo test --no-default-features
|