Skip to content

Commit 1fa6e7c

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

File tree

3 files changed

+66
-24
lines changed

3 files changed

+66
-24
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -107,38 +107,45 @@ 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 'bundle-summary<<EOF' >> $GITHUB_ENV
133+
make bundle-size | tail -n3 >> $GITHUB_ENV
134+
echo 'EOF' >> $GITHUB_ENV
135+
136+
- name: Find Comment
137+
uses: peter-evans/find-comment@v2
138+
id: fc
134139
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]
140+
issue-number: ${{ github.event.pull_request.number }}
141+
comment-author: 'github-actions[bot]'
142+
body-regex: "^### WASM bundle size$"
143+
- name: Create or update comment
144+
uses: peter-evans/create-or-update-comment@v2
145+
with:
146+
comment-id: ${{ steps.fc.outputs.comment-id }}
147+
issue-number: ${{ github.event.pull_request.number }}
148+
body: |
149+
### WASM bundle size
150+
${{ env.bundle-summary }}
151+
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)