Skip to content

Commit b965add

Browse files
committed
update master, notify pr
1 parent 058ac8b commit b965add

File tree

3 files changed

+64
-24
lines changed

3 files changed

+64
-24
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -107,38 +107,43 @@ jobs:
107107
uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
108108
with:
109109
files: lcov.info
110-
# Check if the bundle size was committed and is up-to-date
110+
# Lint shell scripts
111+
shellcheck:
112+
runs-on: ubuntu-latest
113+
steps:
114+
- name: Checkout
115+
uses: actions/checkout@v3
116+
- name: Run shellcheck
117+
uses: ludeeus/[email protected]
111118
bundle-size:
112119
runs-on: ubuntu-latest
113120
steps:
114121
- name: Checking out
115-
uses: actions/checkout@v2
116-
with:
117-
ref: ${{ github.head_ref }}
118-
fetch-depth: 0
122+
uses: actions/checkout@v3
119123
- name: Install Rust toolchain
120124
uses: ./.github/actions/rust-cargo-run
121125
with:
122126
command: version
123127
github_token: ${{ secrets.GITHUB_TOKEN }}
124128
save_cache: true
125-
- name: Update bundle size
129+
- name: Show bundle delta summary
130+
id: bundle-summary
126131
run: |
127-
git config --local user.email "github-actions[bot]@users.noreply.github.com"
128-
git config --local user.name "github-actions[bot]"
129-
make bundle-size
130-
git add bundle-size
131-
git commit -m "[skip ci] update bundle-size" || true
132-
- name: Push changes
133-
uses: ad-m/github-push-action@master
132+
echo "summary=$(make bundle-size | tail -n3)" >> $$GITHUB_OUTPUT
133+
- name: Find Comment
134+
uses: peter-evans/find-comment@v2
135+
id: fc
134136
with:
135-
github_token: ${{ secrets.GITHUB_TOKEN }}
136-
branch: ${{ github.head_ref }}
137-
# Lint shell scripts
138-
shellcheck:
139-
runs-on: ubuntu-latest
140-
steps:
141-
- name: Checkout
142-
uses: actions/checkout@v3
143-
- name: Run shellcheck
144-
uses: ludeeus/[email protected]
137+
issue-number: ${{ github.event.pull_request.number }}
138+
comment-author: 'github-actions[bot]'
139+
body-includes: "### WASM bundle size"
140+
141+
- name: Create or update comment
142+
uses: peter-evans/create-or-update-comment@v2
143+
with:
144+
comment-id: ${{ steps.fc.outputs.comment-id }}
145+
issue-number: ${{ github.event.pull_request.number }}
146+
body: |
147+
### WASM bundle size
148+
${{ steps.bundle-summary.outputs.summary }}
149+
edit-mode: replace
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Update WASM bundle size
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
# Check if the bundle size was committed and is up-to-date
9+
jobs:
10+
bundle-size:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checking out
14+
uses: actions/checkout@v3
15+
with:
16+
ref: ${{ github.head_ref }}
17+
fetch-depth: 0
18+
- name: Install Rust toolchain
19+
uses: ./.github/actions/rust-cargo-run
20+
with:
21+
command: version
22+
github_token: ${{ secrets.GITHUB_TOKEN }}
23+
save_cache: true
24+
- name: Update bundle size
25+
run: |
26+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
27+
git config --local user.name "github-actions[bot]"
28+
make bundle-size
29+
git add bundle-size
30+
git commit -m "[skip ci] update bundle-size" || true
31+
- name: Push changes
32+
uses: ad-m/github-push-action@master
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
branch: ${{ github.head_ref }}

bundle-size

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6030520
1+
6033977

0 commit comments

Comments
 (0)