diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0aa2d77ca2..bc926cce7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,38 +107,45 @@ jobs: uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 with: files: lcov.info - # Check if the bundle size was committed and is up-to-date + # Lint shell scripts + shellcheck: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Run shellcheck + uses: ludeeus/action-shellcheck@1.1.0 bundle-size: runs-on: ubuntu-latest steps: - name: Checking out - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - fetch-depth: 0 + uses: actions/checkout@v3 - name: Install Rust toolchain uses: ./.github/actions/rust-cargo-run with: command: version github_token: ${{ secrets.GITHUB_TOKEN }} save_cache: true - - name: Update bundle size + - name: Show bundle delta summary + id: bundle-summary run: | - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - make bundle-size - git add bundle-size - git commit -m "[skip ci] update bundle-size" || true - - name: Push changes - uses: ad-m/github-push-action@master + echo 'bundle-summary<> $GITHUB_ENV + make bundle-size | tail -n3 >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV + + - name: Find Comment + uses: peter-evans/find-comment@v2 + id: fc with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.head_ref }} - # Lint shell scripts - shellcheck: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Run shellcheck - uses: ludeeus/action-shellcheck@1.1.0 + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-regex: "^### WASM bundle size$" + - name: Create or update comment + uses: peter-evans/create-or-update-comment@v2 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + ### WASM bundle size + ${{ steps.env.bundle-summary }} + edit-mode: replace diff --git a/.github/workflows/update-bundle-size.yml b/.github/workflows/update-bundle-size.yml new file mode 100644 index 0000000000..cd94d5c971 --- /dev/null +++ b/.github/workflows/update-bundle-size.yml @@ -0,0 +1,35 @@ +name: Update WASM bundle size + +on: + push: + branches: + - master + +# Check if the bundle size was committed and is up-to-date +jobs: + bundle-size: + runs-on: ubuntu-latest + steps: + - name: Checking out + uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + - name: Install Rust toolchain + uses: ./.github/actions/rust-cargo-run + with: + command: version + github_token: ${{ secrets.GITHUB_TOKEN }} + save_cache: true + - name: Update bundle size + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + make bundle-size + git add bundle-size + git commit -m "[skip ci] update bundle-size" || true + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.head_ref }} diff --git a/bundle-size b/bundle-size index 2cab2b059d..97f0dd0bcd 100644 --- a/bundle-size +++ b/bundle-size @@ -1 +1 @@ -6030520 +6033977