minify-html/.github/workflows/bench.yaml

63 lines
1.7 KiB
YAML
Raw Normal View History

2020-01-25 22:38:14 -05:00
name: Run benchmark and upload results
on:
2021-08-05 22:22:24 -04:00
push:
2020-01-25 22:38:14 -05:00
tags:
- 'v*'
2021-08-05 22:22:24 -04:00
workflow_dispatch:
2020-01-25 22:38:14 -05:00
jobs:
bench:
2021-04-06 04:50:24 -04:00
runs-on: ubuntu-18.04
2020-01-25 22:38:14 -05:00
steps:
- uses: actions/checkout@v1
2020-07-25 00:31:55 -04:00
2020-01-25 22:38:14 -05:00
- name: Get version
id: version
shell: bash
2020-06-18 23:00:25 -04: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 00:31:55 -04:00
2020-01-25 22:38:14 -05:00
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
2020-01-25 22:38:14 -05:00
profile: minimal
default: true
2020-07-25 00:31:55 -04:00
- name: Set up Go
uses: actions/setup-go@v2
2020-07-10 11:25:18 -04:00
with:
go-version: '^1.14.0'
2020-07-25 00:31:55 -04:00
- name: Run prebuild steps
shell: bash
run: bash ./prebuild.sh
2020-07-25 00:31:55 -04:00
- name: Set up Node.js for benching
uses: actions/setup-node@master
with:
2021-08-07 21:17:32 -04:00
node-version: 16.x
2020-07-25 00:31:55 -04:00
2020-01-25 22:38:14 -05:00
- name: Set up Node.js module
working-directory: ./nodejs
2021-04-06 04:55:28 -04:00
run: |
node package.json.gen.js js
npm install
2020-07-25 00:31:55 -04:00
2020-01-25 22:38:14 -05:00
- name: Build bench
working-directory: ./bench
run: |
2021-08-08 09:11:05 -04:00
./build
2020-07-25 00:31:55 -04:00
- name: Set up Backblaze B2 CLI
uses: wilsonzlin/setup-b2@v3
2020-07-25 00:31:55 -04:00
- name: Run bench and upload results
working-directory: ./bench
2020-06-18 19:49:48 -04:00
run: |
b2 authorize-account ${{ secrets.CICD_CLI_B2_KEY_ID }} ${{ secrets.CICD_CLI_B2_APPLICATION_KEY }}
2021-08-08 09:11:05 -04:00
./run
b2 sync ./graphs/ b2://${{ secrets.CICD_CLI_B2_BUCKET_NAME }}/minify-html/bench/${{ steps.version.outputs.VERSION }}/js/
MHB_HTML_ONLY=1 ./run
b2 sync ./graphs/ b2://${{ secrets.CICD_CLI_B2_BUCKET_NAME }}/minify-html/bench/${{ steps.version.outputs.VERSION }}/core/