-
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (47 loc) · 1.6 KB
/
code_analysis.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Code analysis
on:
workflow_call:
inputs:
skip_rust:
default: false
required: false
type: boolean
skip_sql:
default: false
required: false
type: boolean
env:
CARGO_TERM_COLOR: always
DATABASE_URL: postgres://mango3:mango3@localhost:5432/mango3_test
jobs:
check_rust:
runs-on: ubuntu-24.04
if: ${{ !inputs.skip_rust }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-rust
- name: Check with cargo-fmt
run: cargo fmt --all --check
- name: Check with leptosfmt
run: |
cargo install --force leptosfmt
leptosfmt --check -x mango3-cli -x mango3-core -x mango3-monitor -x mango3-uploads -x target .
- uses: ./.github/actions/setup-database
- name: Check with cargo-clippy
run: cargo clippy -- -D warnings
check_sql:
runs-on: ubuntu-24.04
if: ${{ !inputs.skip_sql }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.13
- uses: actions/cache@v4
with:
path: ~/.local/share/pipx
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipx
- name: Check with sqlfluff
run: |
pipx install sqlfluff~=3.2
sqlfluff lint migrations/*.sql