diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 94ddaf64668d..e058fb2072b5 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -2,7 +2,7 @@ name: Benchmark on: pull_request: - types: ['opened', 'reopened', 'synchronize'] + types: ["opened", "reopened", "synchronize"] push: branches: - main @@ -43,8 +43,8 @@ jobs: benchmark: name: Performance regression check if: >- - ${{ !contains(github.event.head_commit.message, 'chore: ') && github.repository_owner == 'swc-project' }} - runs-on: macos-latest + ${{ !contains(github.event.head_commit.message, 'chore: ') && github.repository_owner == 'swc-project' && github.ref == 'refs/heads/main' }} + runs-on: ubuntu-large steps: - uses: actions/checkout@v3 @@ -77,7 +77,7 @@ jobs: yarn - name: Run benchmark - run: cargo bench --workspace --exclude swc_plugin --features plugin_transform_schema_vtest --features rkyv-impl -- --output-format bencher | tee output.txt + run: cargo bench --workspace --exclude swc_plugin --features plugin_transform_schema_vtest --features rkyv-impl -- --output-format bencher --sample-size 10 | tee output.txt - name: Download previous benchmark results run: mkdir raw-data && curl -o raw-data/benchmark-data.json https://raw.githubusercontent.com/swc-project/raw-data/gh-pages/benchmark-data.json