Skip to content

Commit

Permalink
add CI check for style.css
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptix committed May 18, 2021
1 parent 005c46c commit 89958af
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/check_tailwind_prod_version.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -e

pushd web/styles

npm ci
npm run compile-prod

# if the above results in a changes against HEAD
# an updated version of styles.css needs to be commited.
git diff-index --quiet HEAD || {
echo "git tree is dirty after running compile-prod target"
git diff-index --name-only HEAD
exit 1
}

popd
6 changes: 4 additions & 2 deletions .github/find_large_assets.bash
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/usr/bin/env bash

# files in assets with more then 100kb and count them
count=$(find web/assets -size '+100k' | wc -l)
find web/assets -size '+100k' > /tmp/big-assets.txt
count=$(cat /tmp/big-assets.txt | wc -l)


# make sure count is an integer
let count=count+0


if [ $count -ne 0 ]; then
echo "found $count big assets"
echo "found $count big assets - maybe development tailwind was commited? listing follows:"
cat /tmp/big-assets.txt
exit 1
fi
4 changes: 4 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
with:
node-version: 14.x

- name: See if style.css needs to be updated
run: |
${GITHUB_WORKSPACE}/.github/check_tailwind_prod_version.bash
- name: Set up Go
uses: actions/setup-go@v2
with:
Expand Down

0 comments on commit 89958af

Please sign in to comment.