mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
66 lines
1.5 KiB
YAML
66 lines
1.5 KiB
YAML
name: Rust
|
|
|
|
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:
|
|
rust-fmt:
|
|
name: Rustfmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
override: true
|
|
- run: rustup component add rustfmt
|
|
working-directory: frontend/rust-lib
|
|
- run: cargo fmt --all -- --check
|
|
working-directory: frontend/rust-lib/
|
|
|
|
|
|
rust-clippy:
|
|
runs-on: ubuntu-latest
|
|
name: Clippy
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
override: true
|
|
- run: rustup component add clippy
|
|
working-directory: frontend/rust-lib
|
|
- run: cargo clippy
|
|
working-directory: frontend/rust-lib
|
|
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Install Rust
|
|
run: |
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
source $HOME/.cargo/env
|
|
rustup toolchain install nightly
|
|
rustup default nightly
|
|
- name: Frontend tests
|
|
working-directory: frontend/rust-lib
|
|
run: cargo test
|
|
- name: Shared-lib tests
|
|
working-directory: shared-lib
|
|
run: cargo test
|
|
|