forked from 0LNetworkCommunity/carpe
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (62 loc) · 1.8 KB
/
lint.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: lint
on:
push:
tags:
- '*'
branches:
- '*'
pull_request:
types:
- opened
branches:
- 'release**'
- 'canary**'
- 'main'
jobs:
ts-lint:
runs-on: ubuntu-latest
steps:
# Setup Node.js
- name: setup node
uses: actions/[email protected]
with:
node-version: 20
# checkout
- name: checkout source
uses: actions/[email protected]
- name: yarn installation
run: yarn install
- name: lint TS
run: yarn lint
rust-lint:
runs-on: macos-latest
steps:
# - uses: awalsh128/cache-apt-pkgs-action@latest
# with:
# packages: build-essential lld pkg-config libclang-dev libwebkit2gtk-4.0-dev libglib2.0-* libssl-dev libgtk-3-dev libappindicator3-dev patchelf librsvg2-dev libvips-dev libgmp-dev
# version: 1.0
- name: checkout sources
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set rust_version from rust_toolchain file
run: echo "RUST_VERSION=$(cat src-tauri/rust-toolchain)" >> $GITHUB_ENV
- uses: actions-rs/[email protected]
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
override: true
- name: install rustfmt clippy
shell: bash
run: rustup component add rustfmt clippy
- name: cache rust
uses: Swatinem/rust-cache@v2
with:
shared-key: "libra" # to share across CI builds, so it is not job-id specific
cache-on-failure: true
- name: check format
working-directory: ./src-tauri
run: cargo fmt --all -- --check
- name: lint
working-directory: ./src-tauri
run: cargo clippy --workspace --tests -- -D warnings