Run benchmark and upload results #142
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: Run benchmark and upload results | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
jobs: | |
bench: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Get version | |
id: version | |
shell: bash | |
run: echo ::set-output name=VERSION::"$([[ "$GITHUB_REF" == refs/tags/v* ]] && echo ${GITHUB_REF#refs/tags/v} || echo '0.0.0')" | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
default: true | |
- name: Set up Node.js for benching | |
uses: actions/setup-node@master | |
with: | |
node-version: 16.x | |
- name: Set up Node.js module | |
working-directory: ./minify-html-nodejs | |
run: npm install | |
- name: Build bench | |
working-directory: ./bench | |
run: | | |
./build | |
- name: Set up Backblaze B2 CLI | |
uses: wilsonzlin/setup-b2@v3 | |
- name: Run bench and upload results | |
working-directory: ./bench | |
run: | | |
b2 authorize-account ${{ secrets.CICD_CLI_B2_KEY_ID }} ${{ secrets.CICD_CLI_B2_APPLICATION_KEY }} | |
./run | |
node graph.js | |
b2 sync ./graphs/ b2://${{ secrets.CICD_CLI_B2_BUCKET_NAME }}/minify-html/bench/${{ steps.version.outputs.VERSION }}/js/ | |
MHB_HTML_ONLY=1 ./run | |
node graph.js | |
b2 sync ./graphs/ b2://${{ secrets.CICD_CLI_B2_BUCKET_NAME }}/minify-html/bench/${{ steps.version.outputs.VERSION }}/core/ |