mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Add the crate dependency graph visualization to the contributor guide (#3907)
* Add the crate dependency graph visualization to the contributor guide * Code review fixes * And more
This commit is contained in:
35
.github/workflows/build.yml
vendored
35
.github/workflows/build.yml
vendored
@@ -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:
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@@ -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'
|
||||
@@ -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'
|
||||
@@ -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:
|
||||
|
||||
@@ -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: |
|
||||
@@ -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: |
|
||||
|
||||
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -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:
|
||||
@@ -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:
|
||||
|
||||
26
.github/workflows/website.yml
vendored
26
.github/workflows/website.yml
vendored
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user