Skip to content

Commit

Permalink
🤏 Add gated check for embedded app build
Browse files Browse the repository at this point in the history
  • Loading branch information
runeharlyk committed Mar 17, 2024
1 parent cee0bcb commit 4068d4c
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build-restriction.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Embedded app build size

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: ./app
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'latest'
cache: 'pnpm'
cache-dependency-path: './app/pnpm-lock.yaml'

- name: Install dependencies
run: cd app && pnpm install
- name: List files
run: ls


- name: Check index.html size
run: |
SIZE=$(stat --format=%s ../esp32/data/index.html)
MAXSIZE=204800
if [ $SIZE -gt $MAXSIZE ]; then
echo "index.html is larger than 200KB ($SIZE bytes)"
exit 1
else
echo "index.html size is within limit ($SIZE bytes)"
fi

0 comments on commit 4068d4c

Please sign in to comment.