-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (124 loc) · 4.15 KB
/
Copy pathci.yml
File metadata and controls
132 lines (124 loc) · 4.15 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# sqlx compile-time-checked queries (M1+). CI does not have a live DB;
# checked queries resolve against the committed `.sqlx/` cache instead.
# Regenerated locally with `cargo sqlx prepare --workspace`.
SQLX_OFFLINE: "true"
jobs:
rust-fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with: { components: rustfmt }
- run: cargo fmt --all -- --check
rust-test:
name: cargo test + clippy (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with: { components: clippy }
- name: Install Linux Tauri deps
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libxdo-dev libssl-dev \
libayatana-appindicator3-dev librsvg2-dev libsoup-3.0-dev javascriptcoregtk-4.1
- uses: Swatinem/rust-cache@v2
- name: cargo build (compile-only)
run: cargo build --workspace --all-targets
- name: cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: cargo test
run: cargo test --workspace
ui-build:
name: ui build + lint + unit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with: { version: 10 }
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: ui/pnpm-lock.yaml
- name: pnpm install
working-directory: ui
run: pnpm install --frozen-lockfile
- name: lint
working-directory: ui
run: pnpm lint
- name: test:unit
working-directory: ui
run: pnpm test:unit
- name: build
working-directory: ui
run: pnpm build
tauri-compile:
name: tauri compile (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: pnpm/action-setup@v4
with: { version: 10 }
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: ui/pnpm-lock.yaml
- name: Install Linux Tauri deps
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libxdo-dev libssl-dev \
libayatana-appindicator3-dev librsvg2-dev libsoup-3.0-dev javascriptcoregtk-4.1
# src-tauri is a member of the ROOT cargo workspace, so `cargo tauri build`
# writes all compile artifacts to the root `target/`, NOT `src-tauri/target`.
# The old `workspaces: src-tauri` cached the wrong (near-empty, ~128MB) dir, so
# every run was a cold ~7min rebuild. Default workspace (`.` -> ./target) caches
# the real artifacts. prefix-key bumped to v1 to force past the stale v0 fossil
# cache (a full key-match would restore it and skip the corrected save).
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v1-rust"
- name: pnpm install
working-directory: ui
run: pnpm install --frozen-lockfile
- name: ui build
working-directory: ui
run: pnpm build
- name: Install tauri-cli
run: cargo install tauri-cli --version "^2" --locked
- name: cargo tauri build --debug --no-bundle
run: cargo tauri build --debug --no-bundle
cargo-deny:
name: cargo deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check
arguments: --all-features