-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (63 loc) · 2.23 KB
/
lints-and-tests.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
name: Lints and tests
on:
push:
branches: ['main']
pull_request:
branches: ['**']
types: [opened, synchronize]
workflow_dispatch:
jobs:
commit-check:
runs-on: ubuntu-20.04
name: Check conventional commit compliance
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Check commits
uses: cocogitto/cocogitto-action@v3
frontend-checks:
runs-on: ubuntu-20.04
name: Frontend checks
needs: [commit-check]
steps:
- uses: actions/checkout@v4
- uses: volta-cli/action@v4
- run: yarn install --immutable
- name: Frontend check
run: yarn check
- name: Frontend lint
run: yarn lint
- run: yarn playwright install --with-deps
- name: Frontend test
run: yarn test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
backend-checks:
runs-on: ubuntu-20.04
name: Backend checks
needs: [commit-check, frontend-checks]
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
shared-key: whooosh-ubuntu-20.04
workspaces: src-tauri
- uses: dtolnay/rust-toolchain@stable
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
version: 1.0
- name: Backend check
run: cargo check --manifest-path src-tauri/Cargo.toml
- name: Backend lint
run: |
cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check
cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings
- name: Backend test
run: cargo test --manifest-path src-tauri/Cargo.toml