-
Notifications
You must be signed in to change notification settings - Fork 525
174 lines (145 loc) · 4.99 KB
/
ci.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# testing locally with act cli
# act -W .github/workflows/ci.yml --container-architecture linux/amd64 -env ACTIONS_RUNTIME_URL=http://host.docker.internal:8080/ --env ACTIONS_RUNTIME_TOKEN=foo --env ACTIONS_CACHE_URL=http://host.docker.internal:8080/ --artifact-server-path out -j build-ubuntu -P ubuntu-latest=-self-hosted --env-file .env --secret-file .secrets
name: Rust CI
on:
push:
pull_request:
jobs:
test-ubuntu:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-C link-arg=-Wl,--allow-multiple-definition"
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
override: true
cache: true
rustflags: ""
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: .github/scripts/install_dependencies.sh
- name: Copy test image
run: |
mkdir -p target/debug/deps
cp screenpipe-vision/tests/testing_OCR.png target/debug/deps/
- name: Run cargo tests
run: cargo test
- name: Run bun tests
env:
SCREENPIPE_DIR: ${{ runner.workspace }}/screenpipe
PIPE_ID: test
PIPE_FILE: pipe.ts
PIPE_DIR: ${{ runner.workspace }}/screenpipe/pipes/test
run: bun ./scripts/run_tests.js
working-directory: ./screenpipe-js
test-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~\AppData\Local\cargo\
target\
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Rust
run: |
Invoke-WebRequest https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-gnu/rustup-init.exe -OutFile rustup-init.exe
.\rustup-init.exe -y
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
override: true
cache: true
rustflags: ""
- name: setup Bun
uses: oven-sh/setup-bun@v2
- name: Install vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: "2a3138723698306f4261632c92dc782f586167e3"
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: "10.0"
- name: Run pre_build.js
shell: bash
run: bun ./scripts/pre_build.js
working-directory: ./screenpipe-app-tauri
- name: Copy test image
shell: bash
run: |
mkdir -p target/debug/deps || true
cp screenpipe-vision/tests/testing_OCR.png target/debug/deps/
- name: Run specific Windows OCR cargo test
run: cargo test test_process_ocr_task_windows
- name: Run bun tests
env:
SCREENPIPE_DIR: ${{ runner.workspace }}/screenpipe
PIPE_ID: test
PIPE_FILE: pipe.ts
PIPE_DIR: ${{ runner.workspace }}/screenpipe/pipes/test
run: bun ./scripts/run_tests.js
working-directory: ./screenpipe-js
test-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~\AppData\Local\cargo\
target\
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
override: true
cache: true
rustflags: ""
- name: setup Bun
uses: oven-sh/setup-bun@v2
- name: Run pre_build.js
shell: bash
env:
SKIP_SCREENPIPE_SETUP: true # avoid trying to copy screenpipe binaries, not yet built (next step)
run: bun ./scripts/pre_build.js
working-directory: ./screenpipe-app-tauri
- name: Copy test image
shell: bash
run: |
mkdir -p target/debug/deps || true
cp screenpipe-vision/tests/testing_OCR.png target/debug/deps/
- name: Run specific Apple OCR cargo test
shell: bash
env:
DYLD_LIBRARY_PATH: /Users/runner/work/screenpipe/screenpipe/screenpipe-vision/lib
run: cargo test test_apple_native_ocr
- name: Run bun tests
env:
SCREENPIPE_DIR: ${{ runner.workspace }}/screenpipe
PIPE_ID: test
PIPE_FILE: pipe.ts
PIPE_DIR: ${{ runner.workspace }}/screenpipe/pipes/test
run: bun ./scripts/run_tests.js
working-directory: ./screenpipe-js