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 ae20cad commit 933b298
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
pull_request:
branches: [ main ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
ci:
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 933b298

Please sign in to comment.