Skip to content

Commit

Permalink
ci: add ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrykingxyz committed Oct 25, 2023
1 parent 1744a17 commit ec1ae2e
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
pull_request:
branches: [ main ]

jobs:
bench:
runs-on: [self-hosted, rspack-bench]
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Init env
uses: ./.github/actions/env
- name: Build rspack
run: node bin/build-rspack.js
- name: Run benchmark
run: node bin/bench.js
- id: print-compare-results
name: Print compare results
run: |
result=$(node bin/compare-bench.js latest current)
echo "$result"
echo "diff-result=${result//$'\n'/'@@'}" >> $GITHUB_OUTPUT
- name: Check Threshold
run: |
result="${{ steps.print-compare-results.outputs.diff-result }}";
if [[ $result =~ "Threshold exceeded" ]]; then
echo "Some benchmark cases exceed the threshold, please visit the previous step for more information"
exit 1
fi

0 comments on commit ec1ae2e

Please sign in to comment.