This repository has been archived on 2025-10-15. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
minify-html/.github/workflows/bench.yaml

57 lines
1.5 KiB
YAML
Raw Normal View History

2020-01-26 16:38:14 +13:00
name: Run benchmark and upload results
on:
2021-08-06 12:22:24 +10:00
push:
2020-01-26 16:38:14 +13:00
tags:
- 'v*'
2021-08-06 12:22:24 +10:00
workflow_dispatch:
2020-01-26 16:38:14 +13:00
jobs:
bench:
2021-04-06 18:50:24 +10:00
runs-on: ubuntu-18.04
2020-01-26 16:38:14 +13:00
steps:
- uses: actions/checkout@v1
2020-07-25 14:31:55 +10:00
2020-01-26 16:38:14 +13:00
- name: Get version
id: version
shell: bash
2020-06-19 13:00:25 +10:00
run: echo ::set-output name=VERSION::"$([[ "$GITHUB_REF" == refs/tags/v* ]] && echo ${GITHUB_REF#refs/tags/v} || echo '0.0.0')"
2020-07-25 14:31:55 +10:00
2020-01-26 16:38:14 +13:00
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
2020-01-26 16:38:14 +13:00
profile: minimal
default: true
2020-07-25 14:31:55 +10:00
- name: Run prebuild steps
shell: bash
run: bash ./prebuild.sh
2020-07-25 14:31:55 +10:00
- name: Set up Node.js for benching
uses: actions/setup-node@master
with:
2021-08-08 11:17:32 +10:00
node-version: 16.x
2020-07-25 14:31:55 +10:00
2020-01-26 16:38:14 +13:00
- name: Set up Node.js module
working-directory: ./nodejs
2022-06-21 21:52:28 +10:00
run: npm install
2020-07-25 14:31:55 +10:00
2020-01-26 16:38:14 +13:00
- name: Build bench
working-directory: ./bench
run: |
2021-08-08 23:11:05 +10:00
./build
2020-07-25 14:31:55 +10:00
- name: Set up Backblaze B2 CLI
uses: wilsonzlin/setup-b2@v3
2020-07-25 14:31:55 +10:00
- name: Run bench and upload results
working-directory: ./bench
2020-06-19 09:49:48 +10:00
run: |
b2 authorize-account ${{ secrets.CICD_CLI_B2_KEY_ID }} ${{ secrets.CICD_CLI_B2_APPLICATION_KEY }}
2021-08-08 23:11:05 +10:00
./run
2021-08-09 00:08:30 +10:00
node graph.js
2021-08-08 23:11:05 +10:00
b2 sync ./graphs/ b2://${{ secrets.CICD_CLI_B2_BUCKET_NAME }}/minify-html/bench/${{ steps.version.outputs.VERSION }}/js/
MHB_HTML_ONLY=1 ./run
2021-08-09 00:08:30 +10:00
node graph.js
2021-08-08 23:11:05 +10:00
b2 sync ./graphs/ b2://${{ secrets.CICD_CLI_B2_BUCKET_NAME }}/minify-html/bench/${{ steps.version.outputs.VERSION }}/core/