mirror of
https://github.com/AppFlowy-IO/AppFlowy-Cloud.git
synced 2025-04-19 03:24:42 -04:00
* chore: rename folder * chore: add script to remove redis stream * chore: add script to remove redis stream * chore: fix ci
55 lines
1.2 KiB
YAML
55 lines
1.2 KiB
YAML
name: Lint
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
types: [ opened, synchronize, reopened ]
|
|
branches: [ main ]
|
|
|
|
env:
|
|
SQLX_VERSION: 0.7.1
|
|
SQLX_FEATURES: "rustls,postgres"
|
|
SQLX_OFFLINE: true
|
|
RUST_TOOLCHAIN: "1.77"
|
|
|
|
jobs:
|
|
test:
|
|
name: fmt & clippy
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
override: true
|
|
components: rustfmt, clippy
|
|
profile: minimal
|
|
|
|
- name: install prerequisites
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install protobuf-compiler
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: |
|
|
AppFlowy-Cloud
|
|
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-clippy-
|
|
|
|
- name: Copy and rename dev.env to .env
|
|
run: cp dev.env .env
|
|
|
|
- name: Code Gen
|
|
working-directory: ./script
|
|
run: ./code_gen.sh
|
|
|
|
- name: Rustfmt
|
|
run: |
|
|
cargo fmt --check
|
|
|
|
- name: Clippy
|
|
run: cargo clippy --all-targets --all-features --tests -- -D warnings
|