Skip to content

Native demos in the docs #722

Native demos in the docs

Native demos in the docs #722

Workflow file for this run

name: Performance
on:
pull_request:
types:
- opened
- reopened
- synchronize # the head branch is updated from the base branch, new commits are pushed to the head branch, or the base branch is changed
jobs:
performance-test:
strategy:
matrix:
node-version: [ '20' ]
os: [ 'ubuntu-latest' ]
name: Test performance
runs-on: ${{ matrix.os }}
steps:
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d # https://github.com/actions/setup-node/releases/tag/v1.4.4
with:
node-version: ${{ matrix.node-version }}
- name: (base) Checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # https://github.com/actions/checkout/releases/tag/v2.3.4
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: (base) Install dependencies
run: |
npm ci
- name: (base) Run performance tests
run: |
npm run benchmark:write-to-file base.json
- name: (head) Checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # https://github.com/actions/checkout/releases/tag/v2.3.4
with:
clean: false
- name: (head) Install dependencies
run: |
npm ci
- name: (head) Run performance tests
run: |
npm run benchmark:write-to-file head.json
- name: Compare the results
run: |
npm run benchmark:compare-benchmarks base.json head.json performance-report.md
- name: Publish a comment - header
uses: marocchino/sticky-pull-request-comment@6804b5ad49d19c10c9ae7cf5057352f7ff333f31 # https://github.com/marocchino/sticky-pull-request-comment/tree/v1.6.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
## Performance comparison of head (${{ github.event.pull_request.head.sha }}) vs base (${{ github.event.pull_request.base.sha }})
- name: Publish a comment - performance comparison report
uses: marocchino/sticky-pull-request-comment@6804b5ad49d19c10c9ae7cf5057352f7ff333f31 # https://github.com/marocchino/sticky-pull-request-comment/tree/v1.6.0
with:
append: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: performance-report.md