-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from xdxxxdx/fix-perf
feat: Add performance result for outband data
- Loading branch information
Showing
4 changed files
with
99 additions
and
78 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Benchmark for extraction algorithm | ||
on: | ||
push: | ||
branches: | ||
- fix-perf | ||
|
||
permissions: | ||
contents: write | ||
deployments: write | ||
|
||
jobs: | ||
benchmark-inband: | ||
name: Benchmark for extraction algorithm (inband) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
- run: npm ci | ||
- run: npm run build --if-present | ||
- run: node ./perf/perftest-inband.js | tee output.txt | ||
|
||
- name: Store benchmark result | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
name: Extraction algorithm Benchmark for inband data | ||
tool: 'benchmarkjs' | ||
output-file-path: output.txt | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
benchmark-data-dir-path: docs/ | ||
auto-push: true | ||
# Show alert with commit comment on detecting possible performance regression | ||
alert-threshold: '200%' | ||
comment-on-alert: true | ||
fail-on-alert: true | ||
alert-comment-cc-users: '@xdxxxdx' | ||
|
||
|
||
benchmark-outband: | ||
name: Benchmark for extraction algorithm (outband) | ||
runs-on: ubuntu-latest | ||
#run in sequence after benchmark-inband` | ||
needs: benchmark-inband | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
|
||
- name: Build npm | ||
run: | | ||
npm ci | ||
npm run build --if-present | ||
- name: Publish data | ||
run: | | ||
npm run data & | ||
disown # Run npm run data in the background and disown the process | ||
- name: Verify server | ||
run: | | ||
response_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/member-1.ttl) | ||
if [ "$response_code" -eq 200 ]; then | ||
echo "Server verification successful (HTTP 200)" | ||
else | ||
echo "Server verification failed with HTTP $response_code" | ||
exit 1 # Exit the script with an error code | ||
fi | ||
- name: Run Benchmark | ||
run: | | ||
node ./perf/perftest-outband.js | tee output.txt | ||
- name: Store benchmark result | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
name: Extraction algorithm Benchmark for outband data | ||
tool: 'benchmarkjs' | ||
output-file-path: output.txt | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
benchmark-data-dir-path: docs/ | ||
auto-push: true | ||
# Show alert with commit comment on detecting possible performance regression | ||
alert-threshold: '200%' | ||
comment-on-alert: true | ||
fail-on-alert: true | ||
alert-comment-cc-users: '@xdxxxdx' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters