chore: Fix benchmark workflow
MODIFY
.github/workflows/bench_formatter.yml
.github/workflows/bench_formatter.yml
@@ -9,33 +9,28 @@ on:
env:
RUST_LOG: info
- RUST_BACKTRACE: 1
jobs:
bench:
name: Bench
if: github.event.issue.pull_request && contains(github.event.comment.body, '!bench_formatter')
- runs-on: ${{ matrix.os }}
-
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-latest]
+ runs-on: ubuntu-latest
steps:
- - name: Checkout PR Branch
- uses: actions/checkout@v2
+ - name: Get PR SHA
+ id: sha
+ uses: actions/github-script@v4
with:
- submodules: false
-
- - name: Support longpaths
- run: git config core.longpaths true
+ result-encoding: string
+ script: |
+ const response = await github.request(context.payload.issue.pull_request.url);
+ return response.data.head.sha;
- name: Checkout PR Branch
uses: actions/checkout@v2
-
- - name: Fetch Main Branch
- run: git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin main
+ with:
+ submodules: false
+ ref: ${{ steps.sha.outputs.result }}
- name: Install toolchain
run: rustup show

MODIFY
.github/workflows/bench_parser.yml
.github/workflows/bench_parser.yml
@@ -9,33 +9,27 @@ on:
env:
RUST_LOG: info
- RUST_BACKTRACE: 1
jobs:
bench:
name: Bench
if: github.event.issue.pull_request && contains(github.event.comment.body, '!bench_parser')
- runs-on: ${{ matrix.os }}
-
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-latest]
+ runs-on: ubuntu-latest
steps:
+ - name: Get PR SHA
+ id: sha
+ uses: actions/github-script@v4
+ with:
+ result-encoding: string
+ script: |
+ const response = await github.request(context.payload.issue.pull_request.url);
+ return response.data.head.sha;
- name: Checkout PR Branch
uses: actions/checkout@v2
with:
submodules: false
-
- - name: Support longpaths
- run: git config core.longpaths true
-
- - name: Checkout PR Branch
- uses: actions/checkout@v2
-
- - name: Fetch Main Branch
- run: git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin main
+ ref: ${{ steps.sha.outputs.result }}
- name: Install toolchain
run: rustup show

chore: Fix benchmark workflow (#2267)