2020-01-25 22:38:14 -05:00
|
|
|
name: Run benchmark and upload results
|
|
|
|
|
|
|
|
on:
|
|
|
|
create:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
2020-06-18 21:06:22 -04:00
|
|
|
repository_dispatch:
|
|
|
|
types: [wf-bench]
|
2020-01-25 22:38:14 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
bench:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
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:
|
2020-07-03 06:42:10 -04:00
|
|
|
toolchain: stable
|
2020-01-25 22:38:14 -05:00
|
|
|
profile: minimal
|
|
|
|
default: true
|
2020-07-25 00:31:55 -04:00
|
|
|
|
2020-07-10 11:33:38 -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
|
|
|
|
2020-06-19 04:33:04 -04:00
|
|
|
- name: Set up Node.js for generating code
|
|
|
|
uses: actions/setup-node@master
|
|
|
|
with:
|
|
|
|
node-version: 14.x
|
2020-07-25 00:31:55 -04:00
|
|
|
|
2020-07-11 09:25:36 -04:00
|
|
|
- name: Run prebuild steps
|
|
|
|
shell: bash
|
|
|
|
run: bash ./prebuild.sh
|
2020-07-25 00:31:55 -04:00
|
|
|
|
2020-06-19 04:33:04 -04:00
|
|
|
- name: Set up Node.js for benching
|
|
|
|
uses: actions/setup-node@master
|
|
|
|
with:
|
|
|
|
node-version: 10.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
|
|
|
|
run: 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: |
|
|
|
|
sudo apt install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
|
|
|
|
npm install
|
2020-01-26 05:24:33 -05:00
|
|
|
./build.sh
|
2020-07-25 00:31:55 -04:00
|
|
|
|
2020-06-18 19:49:48 -04:00
|
|
|
- name: Install B2 CLI
|
|
|
|
run: |
|
2020-06-18 20:38:08 -04:00
|
|
|
sudo pip install setuptools
|
|
|
|
sudo pip install --upgrade b2
|
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 }}
|
2020-07-25 00:31:55 -04:00
|
|
|
./bench.sh
|
2020-07-25 00:46:44 -04:00
|
|
|
b2 sync ./results/ b2://${{ secrets.CICD_CLI_B2_BUCKET_NAME }}/minify-html/bench/${{ steps.version.outputs.VERSION }}/js/
|
2020-07-25 00:31:55 -04:00
|
|
|
HTML_ONLY=1 ./bench.sh
|
2020-07-25 00:46:44 -04:00
|
|
|
b2 sync ./results/ b2://${{ secrets.CICD_CLI_B2_BUCKET_NAME }}/minify-html/bench/${{ steps.version.outputs.VERSION }}/core/
|