Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/actions/merge-extension-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Merge extension tests into test tree"
description: >
Copies test files from extension subtrees into the main test directories
so they are discovered by the test runner and bucket creation.
Extension tests live in their own repos (single source of truth) and are
pulled in via git subtree — this step avoids duplicating them.

runs:
using: "composite"
steps:
- name: Merge julia-engine tests
shell: bash
run: |
SUBTREE=src/resources/extension-subtrees/julia-engine/tests
cp -r "$SUBTREE/docs/julia-engine" tests/docs/julia-engine
cp -r "$SUBTREE/smoke/julia-engine" tests/smoke/julia-engine
2 changes: 2 additions & 0 deletions .github/workflows/test-smokes-parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
with:
version: ${{ github.ref == 'refs/heads/main' && 'pre-release' || 'release' }}

- uses: ./.github/actions/merge-extension-tests

- name: Create Job for tests
id: tests-buckets
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-smokes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ jobs:
echo "Julia Jupyter:"
uv run julia --project=. -e "import IJulia;println(IJulia.JUPYTER);println(IJulia.find_jupyter_subcommand(\"notebook\"))"

- uses: ./.github/actions/merge-extension-tests

- name: Setup timing file for timed test
if: ${{ matrix.time-test == true }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion src/command/dev-call/pull-git-subtree/cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const SUBTREES: SubtreeConfig[] = [
{
name: "julia-engine",
prefix: "src/resources/extension-subtrees/julia-engine",
remoteUrl: "https://github.com/gordonwoodhull/quarto-julia-engine.git",
remoteUrl: "https://github.com/PumasAI/quarto-julia-engine.git",
remoteBranch: "main",
},
{
Expand Down
100 changes: 100 additions & 0 deletions src/resources/extension-subtrees/julia-engine/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: CI
on:
push:
branches: [main]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
actions: write
contents: read

# Reference quarto-cli version to test against.
# Full commit hash for reproducibility; comment documents the human-readable version.
env:
QUARTO_CLI_REPO: quarto-dev/quarto-cli
QUARTO_CLI_REV: 97e7649bf14607cf39cda13f013185a4146e047b # v1.9.35

jobs:
test:
name: Julia engine tests (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Checkout quarto-cli
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: ${{ env.QUARTO_CLI_REPO }}
ref: ${{ env.QUARTO_CLI_REV }}
path: _quarto-cli

- name: Cache typst-gather build
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: _quarto-cli/package/typst-gather/target
key: ${{ runner.os }}-typst-gather-${{ env.QUARTO_CLI_REV }}

- name: Configure Quarto (Unix)
if: runner.os != 'Windows'
working-directory: _quarto-cli
run: ./configure.sh

- name: Configure Quarto (Windows)
if: runner.os == 'Windows'
working-directory: _quarto-cli
shell: cmd
run: ./configure.cmd

- name: Add quarto to PATH (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
"$(Get-ChildItem -Path _quarto-cli/package/dist/bin/quarto.cmd | ForEach-Object { $_.FullName } | Split-Path)" >> $env:GITHUB_PATH

# Rebuild the bundled JS from our TS source using the configured quarto,
# then verify it matches what's checked in. This catches forgotten rebuilds.
- name: Verify bundled JS is up to date (Unix)
if: runner.os != 'Windows'
run: |
quarto call build-ts-extension src/julia-engine.ts
if ! git diff --exit-code _extensions/julia-engine/julia-engine.js; then
echo "::error::Bundled JS is out of date. Run 'quarto call build-ts-extension src/julia-engine.ts' and commit the result."
exit 1
fi

- name: Verify bundled JS is up to date (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
quarto call build-ts-extension src/julia-engine.ts
git diff --exit-code _extensions/julia-engine/julia-engine.js
if ($LASTEXITCODE -ne 0) {
Write-Error "Bundled JS is out of date. Run 'quarto call build-ts-extension src/julia-engine.ts' and commit the result."
exit 1
}

- name: Setup Julia
uses: julia-actions/setup-julia@5c9647d97b78a5debe5164e9eec09d653d29bd71 # v2.6.1
with:
version: "1.11"

- name: Cache Julia packages
uses: julia-actions/cache@b6a98a496542b2eeda9b4402ce8f79f8fd753d5e # v3.0.0

- name: Run tests (Unix)
if: runner.os != 'Windows'
run: tests/run-tests.sh

- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: tests/run-tests.ps1
7 changes: 3 additions & 4 deletions src/resources/extension-subtrees/julia-engine/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
example.html
example_files/
.DS_Store
.claude/
.quarto/

/.quarto/
**/*.quarto_ipynb
scratch/
61 changes: 61 additions & 0 deletions src/resources/extension-subtrees/julia-engine/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# quarto-julia-engine

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/`.

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.

## Repo structure

- `_extensions/julia-engine/` — the actual extension (contains `_extension.yml`, the bundled `julia-engine.js`, and Julia resource files like `Project.toml`, `*.jl`)
- `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.
- `_quarto.yml` — makes the repo root a quarto project so rendering picks up the extension from `_extensions/`
- `tests/` — self-contained test suite (see Testing below)

## Building

After editing the TypeScript source in `src/`, rebuild the bundled JS:

```sh
quarto call build-ts-extension src/julia-engine.ts
```

This bundles `src/julia-engine.ts` into `_extensions/julia-engine/julia-engine.js`. CI verifies the bundled JS matches the TS source.

## Testing

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).

### Running tests locally

The test runner uses the deno bundled with quarto (to avoid version mismatches):

```sh
# With quarto on PATH:
tests/run-tests.sh

# With explicit quarto path:
QUARTO=/path/to/quarto tests/run-tests.sh

# Run a specific test file:
tests/run-tests.sh smoke/julia-engine/render.test.ts
```

### Quick: render in this repo

Create or edit a `.qmd` file in the repo root (e.g. in `scratch/`) with `engine: julia` and render it:

```sh
quarto render scratch/test.qmd
```

Since this directory is a quarto project with the extension in `_extensions/`, quarto discovers and uses the engine from here.

## CI

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:

1. Configures quarto from the pinned rev
2. Verifies the bundled JS is up to date with the TS source
3. Runs the full test suite

When bumping `QUARTO_CLI_REV`, use the full commit hash annotated with the version tag for clarity (e.g. `abc123 # v1.9.35`).
1 change: 1 addition & 0 deletions src/resources/extension-subtrees/julia-engine/CLAUDE.md
Loading
Loading