Skip to content

ci(benchmark): add PR permissions for comment #674

ci(benchmark): add PR permissions for comment

ci(benchmark): add PR permissions for comment #674

Workflow file for this run

name: Benchmark
on:
push:
paths:
- "lib/**"
pull_request:
branches:
- master
paths-ignore:
- "test/scripts/**"
jobs:
benchmark:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: ["14", "16", "18"]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install --silent
- name: Running benchmark
run: node test/benchmark.js --benchmark
profiling:
runs-on: ${{ matrix.os }}
permissions:
pull-requests: write # for marocchino/sticky-pull-request-comment to create or update PR comment
strategy:
matrix:
os: [ubuntu-latest]
node-version: ["14", "16", "18"]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install --silent
- name: Running profiling
run: node test/benchmark.js --profiling
- name: Publish flamegraph to https://${{ github.sha }}-${{ matrix.node-version }}-hexo.surge.sh/flamegraph.html
uses: dswistowski/surge-sh-action@v1
with:
domain: ${{ github.sha }}-${{ matrix.node-version }}-hexo.surge.sh
project: ./.tmp-hexo-theme-unit-test/0x/
login: ${{ secrets.SURGE_LOGIN }}
token: ${{ secrets.SURGE_TOKEN }}
- name: Comment PR
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
Publish flamegraph to https://${{ github.sha }}-${{ matrix.node-version }}-hexo.surge.sh/flamegraph.html