Skip to content
Merged
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
35 changes: 11 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ jobs:

- name: ✂ Replace template in <head> of index.html
if: github.event_name == 'push'
run: |
sed -i "s|<!-- INDEX_HTML_HEAD_REPLACEMENT -->|$INDEX_HTML_HEAD_REPLACEMENT|" frontend/index.html
run: sed -i "s|<!-- INDEX_HTML_HEAD_REPLACEMENT -->|$INDEX_HTML_HEAD_REPLACEMENT|" frontend/index.html

- name: 🌐 Build Graphite web code
env:
Expand Down Expand Up @@ -165,8 +164,7 @@ jobs:

- name: ✂ Strip analytics script from built output for clean artifact
if: github.event_name == 'push'
run: |
sed -i "s|$INDEX_HTML_HEAD_REPLACEMENT||" frontend/dist/index.html
run: sed -i "s|$INDEX_HTML_HEAD_REPLACEMENT||" frontend/dist/index.html

- name: 📦 Upload web bundle artifact
uses: actions/upload-artifact@v6
Expand All @@ -177,49 +175,38 @@ jobs:
- name: 📃 Generate code documentation info for website
if: github.event_name == 'push'
run: |
cd tools/editor-message-tree
cargo run
cd ../..
mkdir -p artifacts-generated
mv website/generated/hierarchical_message_system_tree.txt artifacts-generated/hierarchical_message_system_tree.txt
mkdir -p website/generated-new
cargo run -p crate-hierarchy-viz -- website/generated-new/crate_hierarchy.dot
cargo run -p editor-message-tree -- website/generated-new/hierarchical_message_system_tree.txt

- name: 💿 Obtain cache of auto-generated code docs artifacts, to check if they've changed
if: github.event_name == 'push'
id: cache-website-code-docs
uses: actions/cache/restore@v5
with:
path: artifacts
path: website/generated
key: website-code-docs

- name: 🔍 Check if auto-generated code docs artifacts changed
if: github.event_name == 'push'
id: website-code-docs-changed
run: |
if ! diff --brief --recursive artifacts-generated artifacts; then
echo "Auto-generated code docs artifacts have changed."
rm -rf artifacts
mv artifacts-generated artifacts
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "Auto-generated code docs artifacts have not changed."
rm -rf artifacts
rm -rf artifacts-generated
fi
diff --brief --recursive website/generated-new website/generated || echo "changed=true" >> $GITHUB_OUTPUT
rm -rf website/generated
mv website/generated-new website/generated

- name: 💾 Save cache of auto-generated code docs artifacts
if: github.event_name == 'push' && steps.website-code-docs-changed.outputs.changed == 'true'
uses: actions/cache/save@v5
with:
path: artifacts
path: website/generated
key: ${{ steps.cache-website-code-docs.outputs.cache-primary-key }}

- name: ♻️ Trigger website rebuild if the auto-generated code docs artifacts have changed
if: github.event_name == 'push' && steps.website-code-docs-changed.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rm -rf artifacts
gh workflow run website.yml --ref master
run: gh workflow run website.yml --ref master

windows:
if: github.event_name == 'push' || inputs.windows
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ jobs:

- name: 🦀 Fetch Rust dependencies
if: steps.skip-check.outputs.skip-check != 'true'
run: |
cargo fetch --locked
run: cargo fetch --locked

- name: 🌐 Build Graphite web code
if: steps.skip-check.outputs.skip-check != 'true'
Expand All @@ -72,8 +71,7 @@ jobs:
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
npx wrangler@3 pages deploy "frontend/dist" --project-name="graphite-dev" --commit-dirty=true
run: npx wrangler@3 pages deploy "frontend/dist" --project-name="graphite-dev" --commit-dirty=true

- name: 👕 Lint Graphite web formatting
if: steps.skip-check.outputs.skip-check != 'true'
Expand Down Expand Up @@ -110,15 +108,13 @@ jobs:

- name: 🦀 Fetch Rust dependencies
if: steps.skip-check.outputs.skip-check != 'true'
run: |
cargo fetch --locked
run: cargo fetch --locked

- name: 🧪 Run Rust tests
if: steps.skip-check.outputs.skip-check != 'true'
env:
RUSTFLAGS: -Dwarnings
run: |
mold -run cargo test --all-features
run: mold -run cargo test --all-features

# Rust format check on GitHub runner
rust-fmt:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/comment-profiling-changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ jobs:

- name: Install iai-callgrind
if: steps.cache-iai.outputs.cache-hit != 'true'
run: |
cargo install iai-callgrind-runner@0.16.1
run: cargo install iai-callgrind-runner@0.16.1

- name: Checkout master branch
run: |
Expand Down Expand Up @@ -84,8 +83,7 @@ jobs:
cargo bench --bench run_cached_iai -- --save-baseline=master
- name: Checkout PR branch
run: |
git checkout ${{ github.event.pull_request.head.sha }}
run: git checkout ${{ github.event.pull_request.head.sha }}

- name: Run PR benchmarks
run: |
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ jobs:
target: wasm32-unknown-unknown

- name: ✂ Replace template in <head> of index.html
run: |
sed -i "s|<!-- INDEX_HTML_HEAD_REPLACEMENT -->|$INDEX_HTML_HEAD_REPLACEMENT|" frontend/index.html
run: sed -i "s|<!-- INDEX_HTML_HEAD_REPLACEMENT -->|$INDEX_HTML_HEAD_REPLACEMENT|" frontend/index.html

- name: 🌐 Build Graphite web code
env:
Expand All @@ -59,8 +58,7 @@ jobs:
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
npx wrangler@3 pages deploy "frontend/dist" --project-name="graphite-editor" --branch="master" --commit-dirty=true
run: npx wrangler@3 pages deploy "frontend/dist" --project-name="graphite-editor" --branch="master" --commit-dirty=true

- name: 📦 Upload assets to GitHub release
env:
Expand Down
26 changes: 8 additions & 18 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
id: cache-website-code-docs
uses: actions/cache/restore@v5
with:
path: artifacts
path: website/generated
key: website-code-docs

- name: 📁 Fallback in case auto-generated code docs artifacts weren't cached
Expand All @@ -64,33 +64,24 @@ jobs:
rustup update stable
echo "🦀 Latest updated version of Rust:"
rustc --version
cd tools/editor-message-tree
cargo run
cd ../..
mkdir artifacts
mv website/generated/hierarchical_message_system_tree.txt artifacts/hierarchical_message_system_tree.txt
cargo run -p crate-hierarchy-viz -- website/generated/crate_hierarchy.dot
cargo run -p editor-message-tree -- website/generated/hierarchical_message_system_tree.txt

- name: 🚚 Move `artifacts` contents to website/generated
run: |
mkdir -p website/generated
mv artifacts/* website/generated/

- name: 🔧 Build auto-generated code docs artifacts into HTML
- name: 🔧 Build auto-generated code docs artifacts into HTML/SVG
run: |
cd website
npm ci
npm run generate-editor-structure
npm run generate-crate-hierarchy

- name: 📃 Generate node catalog documentation
run: |
cd tools/node-docs
cargo run
run: cargo run -p node-docs -- website/content/learn/node-catalog

- name: 🌐 Build Graphite website with Zola
env:
MODE: prod
run: |
cd website
npm ci
npm run check
zola --config config.toml build --minify

Expand All @@ -99,5 +90,4 @@ jobs:
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: |
npx wrangler@3 pages deploy "website/public" --project-name="graphite-website" --commit-dirty=true
run: npx wrangler@3 pages deploy "website/public" --project-name="graphite-website" --commit-dirty=true
8 changes: 7 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tools/cargo-run/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ fn explore_usage() {
println!("OPTIONS:");
println!("<tool>:");
println!(" bisect Binary search through recent commits to find which introduced a bug or feature");
println!(" deps View the crate dependency graph for the workspace");
println!(" editor View an interactive outline of the editor's message system architecture");
println!();
}
Expand All @@ -67,6 +68,7 @@ fn run_task(task: &Task) -> Result<(), Error> {
if let Action::Explore(tool) = &task.action {
match tool.as_deref() {
Some("bisect") => return open_url("https://graphite.art/volunteer/guide/codebase-overview/debugging-tips/#build-bisect-tool"),
Some("deps") => return open_url("https://graphite.art/volunteer/guide/codebase-overview/#crate-dependency-graph"),
Some("editor") => return open_url("https://graphite.art/volunteer/guide/codebase-overview/editor-structure/#editor-outline"),
None | Some("--help") => {
explore_usage();
Expand Down
2 changes: 1 addition & 1 deletion tools/crate-hierarchy-viz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ authors.workspace = true

[dependencies]
serde = { workspace = true }
clap = { workspace = true, features = ["derive"] }
toml = "0.8"
anyhow = { workspace = true }
glob = "0.3"
Loading
Loading