-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (64 loc) · 1.85 KB
/
ci.yml
File metadata and controls
73 lines (64 loc) · 1.85 KB
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
name: CI
on:
push:
branches: ['**']
pull_request:
branches: ['**']
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
node:
name: Node (Svelte) - format & lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- run: npm ci
- run: npm run format
- run: npm run lint
- name: Fail if formatting changed files
run: |
if ! git diff --quiet; then
echo "Formatter changed files. Please commit the updates."
git status --porcelain
exit 1
fi
rust:
name: Rust - fmt, clippy & unit testing
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0 # Disable incremental compilation for faster from-scratch builds
runs-on: ubuntu-latest
defaults:
run:
working-directory: src-tauri
steps:
- uses: actions/checkout@v4
- name: Install Linux system deps
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config build-essential \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libglib2.0-dev
sudo apt-get install -y libwebkit2gtk-4.1-dev || sudo apt-get install -y libwebkit2gtk-4.0-dev
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Run rustfmt
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- uses: ikalnytskyi/action-setup-postgres@v8
id: postgres
- name: Run unit tests
run: cargo test --locked