Skip to content

Commit 7c54b3b

Browse files
committed
ci: add job for checking committed bundle
1 parent b96b58e commit 7c54b3b

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
push:
44
branches:
55
- main
6+
tags:
7+
- v*
68
pull_request:
79
branches:
810
- main
@@ -50,3 +52,39 @@ jobs:
5052
run: pnpm install
5153
- name: Run unit-tests
5254
run: pnpm run test
55+
56+
bundle:
57+
runs-on: ubuntu-latest
58+
needs:
59+
- typos
60+
- tests
61+
steps:
62+
- name: Check out repository
63+
uses: actions/checkout@v4
64+
- name: Set up pnpm
65+
uses: pnpm/action-setup@v4
66+
with:
67+
version: ${{ env.PNPM_VERSION }}
68+
- name: Set up Node
69+
uses: actions/setup-node@v4
70+
with:
71+
node-version: ${{ env.NODE_VERSION }}
72+
cache: pnpm
73+
- name: Install dependencies
74+
run: pnpm install
75+
- name: Clean up bundle
76+
run: pnpm run clean
77+
- name: Build and bundle code
78+
run: pnpm run build
79+
- name: Check committed bundle
80+
run: |
81+
diffs="$(git diff --ignore-space-at-eol --text ./dist/)"
82+
if [ -f "./dist/index.js" -a -z "$diffs" ]; then
83+
echo "Committed bundle is up-to-date!"
84+
exit 0
85+
fi
86+
87+
echo "Committed bundle is not up-to-date!"
88+
echo ""
89+
echo "$diffs"
90+
exit 1

0 commit comments

Comments
 (0)