-
Notifications
You must be signed in to change notification settings - Fork 48
85 lines (78 loc) · 2.15 KB
/
lint.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Lint
on: [pull_request, push]
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
src: ${{ steps.changes.outputs.src }}
srctauri: ${{ steps.changes.outputs.srctauri }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
src:
- 'src/**'
srctauri:
- 'src-tauri/**'
eslint:
name: eslint
needs: changes
if: needs.changes.outputs.src == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- uses: reviewdog/action-eslint@v1
if: github.event_name == 'push'
with:
reporter: github-check
eslint_flags: 'src/'
- uses: reviewdog/action-eslint@v1
if: github.event_name == 'pull_request'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
eslint_flags: 'src/'
clippy_check:
name: clippy check
needs: changes
if: needs.changes.outputs.srctauri == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
key: clippy
workspaces: |
src-tauri
- name: install dependencies
run: |
mkdir -p dist
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.1 libappindicator3-dev librsvg2-dev patchelf libasound2-dev
touch src-tauri/dbip.mmdb
- uses: sksat/action-clippy@main
if: github.event_name == 'push'
with:
working_directory: ./src-tauri
reporter: github-check
- uses: sksat/action-clippy@main
if: github.event_name == 'pull_request'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
working_directory: ./src-tauri
reporter: github-pr-review