forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (88 loc) · 2.86 KB
/
Copy pathdesktop-checks.yml
File metadata and controls
100 lines (88 loc) · 2.86 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
name: Desktop Checks
on:
push:
branches: main
pull_request:
branches: main
concurrency:
group: desktop-checks-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
diff_base: ${{ steps.changes.outputs.diff_base }}
has_desktop_agent_runtime: ${{ steps.changes.outputs.has_desktop_agent_runtime }}
has_desktop_rust: ${{ steps.changes.outputs.has_desktop_rust }}
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Detect changed paths
id: changes
uses: ./.github/actions/detect-changes
rust-backend:
name: Rust Backend
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.has_desktop_rust == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Save changed files
run: |
scripts/changed-files "${{ needs.changes.outputs.diff_base }}"...HEAD > /tmp/changed-files.txt
cat /tmp/changed-files.txt
- name: Set up desktop Rust toolchain
run: |
cd desktop/macos/Backend-Rust
rustup show
- name: Cache desktop Rust backend build
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
desktop/macos/Backend-Rust/target
key: ${{ runner.os }}-desktop-rust-${{ hashFiles('desktop/macos/Backend-Rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-desktop-rust-
- name: Check desktop Rust backend
run: |
FILES=$(while IFS= read -r file; do
if [[ "$file" =~ ^desktop/macos/Backend-Rust/.*\.rs$ ]] && [ -f "$file" ]; then
echo "${file#desktop/macos/Backend-Rust/}"
fi
done < /tmp/changed-files.txt)
if [ -n "$FILES" ]; then
(
cd desktop/macos/Backend-Rust
printf '%s\n' "$FILES" | xargs -d '\n' rustfmt --edition 2021 --check
)
fi
cd desktop/macos/Backend-Rust
cargo check --locked
agent-runtime:
name: Agent Runtime
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.has_desktop_agent_runtime == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Node.js for desktop agent runtime
uses: actions/setup-node@v7
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: |
desktop/macos/agent/package-lock.json
desktop/macos/pi-mono-extension/package-lock.json
- name: Check desktop agent runtime
run: desktop/macos/scripts/test-tool-surfaces.sh