Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh/actions: run benchmark and NPM diff on correct base commits #3427

Merged
merged 2 commits into from Dec 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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