[pull] master from highcharts:master #1122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dashboards benchmark | |
on: | |
pull_request: | |
branches: | |
- 'master' | |
paths: | |
- 'ts/Dashboards/**' | |
- 'ts/Data/**' | |
- 'test/ts-node-unit-tests/benchmark/Dashboards/*' | |
- '.github/workflows/dashboards-benchmark.yml' | |
workflow_dispatch: | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
dashboard_benchmark: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
strategy: | |
matrix: | |
node-version: [lts/iron] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: master | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- run: npm i | |
- name: Build Highcharts | |
run: npx gulp scripts | |
- name: Build Dashboards | |
run: npx gulp dashboards/scripts | |
- name: Benchmark | |
continue-on-error: true | |
run: cd test/ts-node-unit-tests && node -r ts-node/register bench.ts --context base --pattern Dashboards/ | |
- name: Checkout current branch | |
uses: actions/checkout@v3 | |
with: | |
clean: false # do not remove files from previous run | |
- run: npm i | |
- name: Build Highcharts | |
run: npx gulp scripts | |
- name: Build Dashboards | |
run: npx gulp dashboards/scripts | |
- name: Benchmark | |
run: cd test/ts-node-unit-tests && node -r ts-node/register bench.ts --context actual --pattern Dashboards/ | |
- name: Benchmark comparison | |
run: cd test/ts-node-unit-tests && node -r ts-node/register benchmark-compare.ts | |
- name: Store artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: benchmark-files | |
path: | | |
tmp/benchmarks | |
- name: Comment on PR | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{secrets.PR_COMMENT_TOKEN}} | |
script: | | |
const { createOrUpdateComment } = require('./.github/scripts/commentOnPR'); | |
const { readFileSync } = require('node:fs') | |
const benchmarkMD = readFileSync('./tmp/benchmarks/table.md'); | |
await createOrUpdateComment(github, context, 'Benchmark report - Dashboards', benchmarkMD || 'No table to show'); | |
- name: Add to summary | |
if: ${{ always() }} | |
run: | | |
echo "## Benchmark metrics" >> $GITHUB_STEP_SUMMARY | |
cat ./tmp/benchmarks/table.md >> $GITHUB_STEP_SUMMARY | |