Skip to content

Commit bf70518

Browse files
committed
feat: rust interpreter
Signed-off-by: Nick Mitchell <[email protected]>
1 parent 9d9cbda commit bf70518

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+4016
-216
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Rust Interpreter Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
# cancel any prior runs for this workflow and this PR (or branch)
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
rust-interpreter:
16+
name: Test Rust interpreter
17+
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
working-directory: ./pdl-live-react
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 22
27+
- name: Install dependencies
28+
# sleep 2 to wait for ollama to be running... hack warning
29+
run: |
30+
npm ci & sudo apt update && sudo apt install -y libgtk-3-dev libwebkit2gtk-4.1-dev librsvg2-dev patchelf at-spi2-core &
31+
(curl -fsSL https://ollama.com/install.sh | sudo -E sh && sleep 2)
32+
wait
33+
# todo: do this in rust
34+
ollama pull granite3.2:2b
35+
- name: Run interpreter tests
36+
run: npm run test:interpreter

.github/workflows/tauri-cli.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
for i in ./demos/beeai/*.py
4646
do pdl compile beeai $i -g -o /tmp/z.json && jq .description /tmp/z.json
4747
done
48-
48+
4949
- name: Test pdl run against production build
5050
env:
5151
DISPLAY: :1

pdl-live-react/package-lock.json

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pdl-live-react/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
"tauri": "tauri",
1515
"test:quality": "concurrently -n 'lint,types,formatting' 'npm run lint' 'tsc --build --noEmit' \"prettier --check 'tests/**/*.ts' 'src/**/*.{ts,tsx,css}'\"",
1616
"test:ui": "playwright install --with-deps && playwright test",
17-
"test:bee": "until [ -f ./src-tauri/target/debug/pdl ]; do sleep 1; done; for i in ./demos/beeai/*.py; do ./src-tauri/target/debug/pdl compile beeai $i -g --output - | jq; done",
17+
"test:bee": "until [ -f ./src-tauri/target/debug/pdl ]; do sleep 1; done; for i in ./demos/beeai/*.py; do ./src-tauri/target/debug/pdl compile beeai $i -g --output - | jq; done",
18+
"test:interpreter": "cd src-tauri && cargo test",
1819
"types": "(cd .. && python -m src.pdl.pdl --schema > src/pdl/pdl-schema.json) && json2ts ../src/pdl/pdl-schema.json src/pdl_ast.d.ts --unreachableDefinitions && npm run format",
1920
"test": "concurrently -n 'quality,playwright' 'npm run test:quality' 'npm run test:ui'",
2021
"pdl": "./src-tauri/target/debug/pdl",
2122
"view": "npm run pdl view",
2223
"start": "npm run tauri dev"
2324
},
2425
"dependencies": {
26+
"@patternfly/react-code-editor": "^6.1.0",
2527
"@patternfly/react-core": "^6.1.0",
2628
"@tauri-apps/api": "^2.3.0",
2729
"@tauri-apps/plugin-cli": "^2.2.0",

pdl-live-react/src-tauri/.taurignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# emacs temp files
22
*~
33
\#*\#
4-
.\#*
4+
.\#*
5+
tests/**/*.txt
6+
tests/**/*.pdl

0 commit comments

Comments
 (0)