-
-
Notifications
You must be signed in to change notification settings - Fork 22
114 lines (94 loc) · 3.02 KB
/
backend.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Check backend
on:
workflow_dispatch:
push:
paths:
- '.github/workflows/backend.yml'
- 'package.json'
- 'src-tauri/**'
- 'updater/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/backend.yml'
- 'package.json'
- 'src-tauri/**'
- 'updater/**'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
jobs:
rustfmt:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/[email protected]
with:
components: rustfmt
- name: Rustfmt check
run: cargo fmt --manifest-path ./src-tauri/Cargo.toml --all -- --check
# also check updater
- name: Rustfmt check updater
if: matrix.platform != 'ubuntu-latest'
run: cargo fmt --manifest-path ./updater/Cargo.toml --all -- --check
clippy:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/[email protected]
with:
components: clippy
- uses: pnpm/action-setup@v3
with:
version: latest
- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
libwebkit2gtk-4.1-dev \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
src-tauri/target/
updater/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build frontend (creates '../dist')
run: pnpm install && pnpm shupdate && pnpm build:js && pnpm build
- name: Create empty file named "updater" in src-tauri
run: touch src-tauri/updater
- name: Create empty file `extension_webkit/libextension.so` in src-tauri
run: touch src-tauri/extension_webkit/libextension.so
- name: Install patch-crate
run: cargo install patch-crate
continue-on-error: true
- name: Apply patches
run: cd src-tauri && cargo patch-crate
- name: Clippy check
run: cargo clippy --manifest-path ./src-tauri/Cargo.toml --no-default-features -- -D warnings
# Also clippy check updater
- name: Clippy check updater
if: matrix.platform != 'ubuntu-latest'
run: cargo clippy --manifest-path ./updater/Cargo.toml --no-default-features -- -D warnings