Skip to content

Commit

Permalink
gh/actions: run benchmark and NPM diff on correct base commits (#3427)
Browse files Browse the repository at this point in the history
Fixes #3371
  • Loading branch information
IvanGoncharov committed Dec 17, 2021
1 parent 95a85f7 commit 7795192
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/ci.yml
Expand Up @@ -166,11 +166,14 @@ jobs:
benchmark:
name: Run benchmark
runs-on: ubuntu-latest
env:
COMMITS_TO_TEST: ${{ github.event.pull_request.commits || 1 }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Deepen cloned repo
run: 'git fetch --deepen=$COMMITS_TO_TEST'

- name: Setup Node.js
uses: actions/setup-node@v2
Expand All @@ -182,16 +185,19 @@ jobs:
run: npm ci --ignore-scripts

- name: Run Benchmark
run: 'npm run benchmark -- --revs HEAD HEAD~1'
run: 'npm run benchmark -- --revs HEAD "HEAD~$COMMITS_TO_TEST"'

diff-npm-package:
name: Diff content of NPM package
runs-on: ubuntu-latest
env:
COMMITS_TO_TEST: ${{ github.event.pull_request.commits || 1 }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Deepen cloned repo
run: 'git fetch --deepen=$COMMITS_TO_TEST'

- name: Setup Node.js
uses: actions/setup-node@v2
Expand All @@ -203,9 +209,7 @@ jobs:
run: npm ci --ignore-scripts

- name: Generate report
run: 'node resources/diff-npm-package.js $BASE_COMMIT HEAD'
env:
BASE_COMMIT: ${{ github.event.pull_request.base.sha || 'HEAD~1' }}
run: 'node resources/diff-npm-package.js HEAD~$COMMITS_TO_TEST HEAD'

- name: Upload generated report
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 7795192

Please sign in to comment.