Skip to content

Commit

Permalink
Merge branch 'master' into node_fn_rework
Browse files Browse the repository at this point in the history
  • Loading branch information
Keavon committed Sep 16, 2024
2 parents ea5027a + ca0d102 commit 7ec153d
Show file tree
Hide file tree
Showing 51 changed files with 1,519 additions and 935 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Editor: CI & Dev"
name: "Editor: Dev & CI"

on:
push:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ jobs:
override: true
components: clippy

- name: Install Deps
run: sudo apt-get install libgtk-3-dev libsoup2.4-dev libjavascriptcoregtk-4.0-dev libwebkit2gtk-4.0-dev
- name: Install deps
run: |
sudo apt update
sudo apt install libgtk-3-dev libsoup2.4-dev libjavascriptcoregtk-4.0-dev libwebkit2gtk-4.0-dev
- name: Run Clippy
id: clippy
Expand All @@ -52,7 +54,7 @@ jobs:
repo: context.repo.repo,
});
const botComments = comments.filter(comment =>
const botComments = comments.filter((comment) =>
comment.user.type === 'Bot' && comment.body.includes('Clippy Warnings/Errors')
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Profiling
name: Profiling Changes

on:
pull_request:
Expand All @@ -23,8 +23,8 @@ jobs:

- name: Install Valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind
sudo apt update
sudo apt install -y valgrind
- name: Cache dependencies
uses: actions/cache@v3
Expand Down Expand Up @@ -60,32 +60,57 @@ jobs:
echo "$BENCH_OUTPUT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Make old comments collapsed by default
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { data: comments } = await github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
});
const botComments = comments.filter((comment) =>
comment.user.type === 'Bot' && comment.body.includes('Performance Benchmark Results') && comment.body.includes('<details open>')
);
for (const comment of botComments) {
// Edit the comment to remove the "open" attribute from the <details> tag
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id,
body: comment.body.replace('<details open>', '<details>')
});
}
- name: Comment PR
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const benchmarkOutput = JSON.parse(`${{ steps.benchmark.outputs.BENCHMARK_OUTPUT }}`);
let significantChanges = false;
let commentBody = "#### Performance Benchmark Results\n\n";
let commentBody = "";
function formatNumber(num) {
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function formatPercentage(pct) {
const sign = pct >= 0 ? '+' : '';
return `${sign}${pct.toFixed(2)}%`;
}
function padRight(str, len) {
return str.padEnd(len);
}
function padLeft(str, len) {
return str.padStart(len);
}
for (const benchmark of benchmarkOutput) {
if (benchmark.callgrind_summary && benchmark.callgrind_summary.summaries) {
const summary = benchmark.callgrind_summary.summaries[0];
Expand Down Expand Up @@ -119,15 +144,25 @@ jobs:
}
}
}
const output = `
<details open>
<summary>Performance Benchmark Results</summary>
${commentBody}
</details>
`;
if (significantChanges) {
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
body: output
});
} else {
console.log("No significant performance changes detected. Skipping comment.");
console.log(commentBody);
console.log(output);
}
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
},
// Rust Analyzer config
"rust-analyzer.cargo.allTargets": false,
"rust-analyzer.check.command": "clippy",
// ESLint config
"eslint.format.enable": true,
"eslint.workingDirectories": ["./frontend", "./website/other/bezier-rs-demos", "./website"],
Expand Down
Loading

0 comments on commit 7ec153d

Please sign in to comment.