-
Notifications
You must be signed in to change notification settings - Fork 8
129 lines (106 loc) · 3.4 KB
/
Copy pathci.yml
File metadata and controls
129 lines (106 loc) · 3.4 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
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
# Cancel previous runs on same branch/PR
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# ── Rust: build check ─────────────────────────────────────────────
rust-build-check:
name: Rust Build Check (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: frontend-build
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-15
- windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup OpenSSL (Windows, prebuilt)
if: runner.os == 'Windows'
shell: pwsh
run: ./scripts/ci/setup-openssl-windows.ps1
- name: Download frontend build artifacts
uses: actions/download-artifact@v4
with:
name: frontend-dist
path: dist
- name: Create mobile-web dist directory (workaround for Tauri)
shell: bash
run: mkdir -p src/mobile-web/dist
- name: Install Linux system dependencies (Tauri)
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
if apt-cache show libwebkit2gtk-4.1-dev >/dev/null 2>&1; then
WEBKIT_PKG=libwebkit2gtk-4.1-dev
else
WEBKIT_PKG=libwebkit2gtk-4.0-dev
fi
if apt-cache show libappindicator3-dev >/dev/null 2>&1; then
APPINDICATOR_PKG=libappindicator3-dev
else
APPINDICATOR_PKG=libayatana-appindicator3-dev
fi
sudo apt-get install -y --no-install-recommends \
pkg-config \
libglib2.0-dev \
libgtk-3-dev \
libxdo-dev \
"$WEBKIT_PKG" \
"$APPINDICATOR_PKG" \
librsvg2-dev \
patchelf \
libleptonica-dev \
libtesseract-dev \
tesseract-ocr \
tesseract-ocr-eng
- uses: dtolnay/rust-toolchain@stable
- name: Check Rust formatting
run: cargo fmt --all -- --check
- uses: swatinem/rust-cache@v2
with:
shared-key: "ci-check-${{ runner.os }}"
- name: Check compilation
run: cargo check --workspace --exclude sparo-cli
- name: Check CLI compilation
if: runner.os == 'Linux'
run: cargo check -p sparo-cli
# ── Frontend: build ────────────────────────────────────────────────
frontend-build:
name: Frontend Build
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max-old-space-size=6144
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Type-check web UI
run: pnpm run type-check:web
- name: Lint web UI
run: pnpm run lint:web
- name: Build web UI
run: pnpm run build:web:unchecked
- name: Upload frontend build artifacts
uses: actions/upload-artifact@v4
with:
name: frontend-dist
path: dist
retention-days: 1