AppFlowy/.github/workflows/frontend_rust.yml

66 lines
1.5 KiB
YAML
Raw Normal View History

2021-12-01 12:31:56 +00:00
name: Frontend_Rust
2021-11-29 13:46:04 +00:00
on:
push:
branches: [ main ]
2021-12-01 03:08:37 +00:00
paths:
- 'frontend/rust-lib'
- 'shared-lib'
2021-11-29 13:46:04 +00:00
pull_request:
branches: [ main ]
2021-12-01 03:08:37 +00:00
paths:
- 'frontend/rust-lib'
- 'shared-lib'
2021-11-29 13:46:04 +00:00
env:
CARGO_TERM_COLOR: always
jobs:
rust-fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
2021-12-01 03:01:03 +00:00
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
2022-01-23 03:34:41 +00:00
toolchain: stable
2021-12-01 03:01:03 +00:00
override: true
- run: rustup component add rustfmt
2021-11-30 09:55:25 +00:00
working-directory: frontend/rust-lib
2021-12-01 03:01:03 +00:00
- run: cargo fmt --all -- --check
working-directory: frontend/rust-lib/
2021-11-30 07:40:11 +00:00
2021-11-29 13:46:04 +00:00
rust-clippy:
runs-on: ubuntu-latest
name: Clippy
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
2021-12-01 03:03:52 +00:00
with:
2022-01-23 03:34:41 +00:00
toolchain: stable
2021-12-01 03:03:52 +00:00
override: true
2021-11-29 13:46:04 +00:00
- run: rustup component add clippy
working-directory: frontend/rust-lib
- run: cargo clippy
working-directory: frontend/rust-lib
2021-12-01 03:11:36 +00:00
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
2021-12-01 03:11:36 +00:00
source $HOME/.cargo/env
2022-01-23 03:34:41 +00:00
rustup toolchain install stable
rustup default stable
2021-12-01 03:11:36 +00:00
- name: Frontend tests
working-directory: frontend/rust-lib
run: cargo test
- name: Shared-lib tests
working-directory: shared-lib
run: cargo test