Skip to content

Commit 503a883

Browse files
committed
ci: create lint.yml
1 parent c7d50d7 commit 503a883

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/lint.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
format:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Rust nightly
16+
run: |
17+
rustup toolchain install nightly
18+
rustup component add --toolchain nightly rustfmt
19+
- name: Check formatting
20+
run: cd src-tauri; cargo fmt -- --check
21+
22+
clippy:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Install dependencies
28+
run: |
29+
# From: https://tauri.app/v1/guides/getting-started/prerequisites
30+
sudo apt update
31+
sudo apt install libwebkit2gtk-4.1-dev \
32+
build-essential \
33+
curl \
34+
wget \
35+
file \
36+
libxdo-dev \
37+
libssl-dev \
38+
libayatana-appindicator3-dev \
39+
librsvg2-dev
40+
41+
- name: Set up Rust nightly
42+
run: |
43+
rustup toolchain install nightly
44+
rustup component add --toolchain nightly clippy
45+
46+
- name: Python setup
47+
uses: actions/setup-python@v4
48+
with:
49+
python-version: '3.11'
50+
51+
- name: Python cache
52+
uses: actions/cache@v3
53+
with:
54+
path: ~/.cache/pip
55+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
56+
restore-keys: |
57+
${{ runner.os }}-pip-
58+
59+
- name: Install Poetry
60+
run: |
61+
curl -sSL https://install.python-poetry.org | python3 -
62+
export PATH="$HOME/.local/bin:$PATH"
63+
64+
- name: Install node dependencies
65+
run: npm install
66+
67+
- name: Prebuild
68+
run: |
69+
make prebuild
70+
71+
- name: Run clippy
72+
run: cd src-tauri; cargo clippy

0 commit comments

Comments
 (0)