Skip to content

Commit 70adfb0

Browse files
Merge commit '350586c71b4eda3ebdbbe15cb8dfd6d2030408d9' into bugfix/14233-clean
2 parents 5f25823 + 350586c commit 70adfb0

File tree

25 files changed

+833
-1686
lines changed

25 files changed

+833
-1686
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
actions: write
13+
contents: read
14+
15+
# Reference quarto-cli version to test against.
16+
# Full commit hash for reproducibility; comment documents the human-readable version.
17+
env:
18+
QUARTO_CLI_REPO: quarto-dev/quarto-cli
19+
QUARTO_CLI_REV: 97e7649bf14607cf39cda13f013185a4146e047b # v1.9.35
20+
21+
jobs:
22+
test:
23+
name: Julia engine tests (${{ matrix.os }})
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
os: [ubuntu-latest, macos-latest, windows-latest]
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32+
33+
- name: Checkout quarto-cli
34+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
35+
with:
36+
repository: ${{ env.QUARTO_CLI_REPO }}
37+
ref: ${{ env.QUARTO_CLI_REV }}
38+
path: _quarto-cli
39+
40+
- name: Cache typst-gather build
41+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
42+
with:
43+
path: _quarto-cli/package/typst-gather/target
44+
key: ${{ runner.os }}-typst-gather-${{ env.QUARTO_CLI_REV }}
45+
46+
- name: Configure Quarto (Unix)
47+
if: runner.os != 'Windows'
48+
working-directory: _quarto-cli
49+
run: ./configure.sh
50+
51+
- name: Configure Quarto (Windows)
52+
if: runner.os == 'Windows'
53+
working-directory: _quarto-cli
54+
shell: cmd
55+
run: ./configure.cmd
56+
57+
- name: Add quarto to PATH (Windows)
58+
if: runner.os == 'Windows'
59+
shell: pwsh
60+
run: |
61+
"$(Get-ChildItem -Path _quarto-cli/package/dist/bin/quarto.cmd | ForEach-Object { $_.FullName } | Split-Path)" >> $env:GITHUB_PATH
62+
63+
# Rebuild the bundled JS from our TS source using the configured quarto,
64+
# then verify it matches what's checked in. This catches forgotten rebuilds.
65+
- name: Verify bundled JS is up to date (Unix)
66+
if: runner.os != 'Windows'
67+
run: |
68+
quarto call build-ts-extension src/julia-engine.ts
69+
if ! git diff --exit-code _extensions/julia-engine/julia-engine.js; then
70+
echo "::error::Bundled JS is out of date. Run 'quarto call build-ts-extension src/julia-engine.ts' and commit the result."
71+
exit 1
72+
fi
73+
74+
- name: Verify bundled JS is up to date (Windows)
75+
if: runner.os == 'Windows'
76+
shell: pwsh
77+
run: |
78+
quarto call build-ts-extension src/julia-engine.ts
79+
git diff --exit-code _extensions/julia-engine/julia-engine.js
80+
if ($LASTEXITCODE -ne 0) {
81+
Write-Error "Bundled JS is out of date. Run 'quarto call build-ts-extension src/julia-engine.ts' and commit the result."
82+
exit 1
83+
}
84+
85+
- name: Setup Julia
86+
uses: julia-actions/setup-julia@5c9647d97b78a5debe5164e9eec09d653d29bd71 # v2.6.1
87+
with:
88+
version: "1.11"
89+
90+
- name: Cache Julia packages
91+
uses: julia-actions/cache@b6a98a496542b2eeda9b4402ce8f79f8fd753d5e # v3.0.0
92+
93+
- name: Run tests (Unix)
94+
if: runner.os != 'Windows'
95+
run: tests/run-tests.sh
96+
97+
- name: Run tests (Windows)
98+
if: runner.os == 'Windows'
99+
shell: pwsh
100+
run: tests/run-tests.ps1
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
example.html
2-
example_files/
1+
.DS_Store
2+
.claude/
33
.quarto/
4-
5-
/.quarto/
64
**/*.quarto_ipynb
5+
scratch/
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# quarto-julia-engine
2+
3+
This repo contains the Julia execution engine for Quarto. The engine was originally built directly into quarto-cli but has since been refactored into an extension-style engine, moved into this separate repo, and is pulled into quarto-cli via a git subtree at `src/resources/extension-subtrees/julia-engine/`.
4+
5+
The engine extension requires a compatible version of quarto (>= 1.9.0). If work involves changes to the engine–quarto interface, you'll also need a corresponding dev build of quarto-cli with matching changes.
6+
7+
## Repo structure
8+
9+
- `_extensions/julia-engine/` — the actual extension (contains `_extension.yml`, the bundled `julia-engine.js`, and Julia resource files like `Project.toml`, `*.jl`)
10+
- `src/` — TypeScript source for the engine (`julia-engine.ts`, `constants.ts`). Changes here must be bundled into `_extensions/julia-engine/julia-engine.js` to take effect.
11+
- `_quarto.yml` — makes the repo root a quarto project so rendering picks up the extension from `_extensions/`
12+
- `tests/` — self-contained test suite (see Testing below)
13+
14+
## Building
15+
16+
After editing the TypeScript source in `src/`, rebuild the bundled JS:
17+
18+
```sh
19+
quarto call build-ts-extension src/julia-engine.ts
20+
```
21+
22+
This bundles `src/julia-engine.ts` into `_extensions/julia-engine/julia-engine.js`. CI verifies the bundled JS matches the TS source.
23+
24+
## Testing
25+
26+
Tests are self-contained Deno tests using `jsr:` imports — no import map or quarto internals needed. `tests/docs/` contains `.qmd` files and quarto projects that the `.test.ts` files in `tests/smoke/` render and verify. These directories mirror quarto-cli's `tests/docs/` and `tests/smoke/` structure and are intended to be merged into those directories when quarto-cli runs its own CI (since this extension is a fixed part of quarto-cli via git subtree).
27+
28+
### Running tests locally
29+
30+
The test runner uses the deno bundled with quarto (to avoid version mismatches):
31+
32+
```sh
33+
# With quarto on PATH:
34+
tests/run-tests.sh
35+
36+
# With explicit quarto path:
37+
QUARTO=/path/to/quarto tests/run-tests.sh
38+
39+
# Run a specific test file:
40+
tests/run-tests.sh smoke/julia-engine/render.test.ts
41+
```
42+
43+
### Quick: render in this repo
44+
45+
Create or edit a `.qmd` file in the repo root (e.g. in `scratch/`) with `engine: julia` and render it:
46+
47+
```sh
48+
quarto render scratch/test.qmd
49+
```
50+
51+
Since this directory is a quarto project with the extension in `_extensions/`, quarto discovers and uses the engine from here.
52+
53+
## CI
54+
55+
CI runs on all three platforms (Linux, macOS, Windows) against a pinned quarto-cli revision (see `QUARTO_CLI_REV` in `.github/workflows/ci.yml`). It:
56+
57+
1. Configures quarto from the pinned rev
58+
2. Verifies the bundled JS is up to date with the TS source
59+
3. Runs the full test suite
60+
61+
When bumping `QUARTO_CLI_REV`, use the full commit hash annotated with the version tag for clarity (e.g. `abc123 # v1.9.35`).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

0 commit comments

Comments
 (0)