feat: add brotli compression #15
This file contains hidden or 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: Sizer | |
| on: | |
| pull_request: | |
| branches: [dev] | |
| types: [opened, synchronize] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/setup-node@v2 | |
| with: | |
| node-version: "14" | |
| - name: Deps | |
| run: | | |
| sudo apt update | |
| sudo apt install zlib* libbrotli-dev | |
| - name: Checkout | |
| with: | |
| ref: dev | |
| path: base | |
| uses: actions/checkout@v2 | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| path: changes | |
| - id: dev_state_size | |
| run: | | |
| cd base | |
| make filesize | |
| ./bin/filesize ./bin/filesize > out.md | |
| OUT="$(cat out.md)" | |
| OUT="${OUT//'%'/'%25'}" | |
| OUT="${OUT//$'\n'/'%0A'}" | |
| OUT="${OUT//$'\r'/'%0D'}" | |
| echo "::set-output name=size::$OUT" | |
| - id: current_state_size | |
| run: | | |
| cd changes | |
| make filesize | |
| ./bin/filesize ./bin/filesize > out.md | |
| OUT="$(cat out.md)" | |
| OUT="${OUT//'%'/'%25'}" | |
| OUT="${OUT//$'\n'/'%0A'}" | |
| OUT="${OUT//$'\r'/'%0D'}" | |
| echo "::set-output name=size::$OUT" | |
| - uses: actions/github-script@v5 | |
| with: | |
| script: | | |
| const message = ` | |
| **Base** | |
| ${{ steps.dev_state_size.outputs.size }} | |
| **PR** | |
| ${{ steps.current_state_size.outputs.size }} | |
| `; | |
| await github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: message | |
| }) |