Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Add a workflow to validate the generated assets on CI. #233

Merged
merged 2 commits into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,36 @@ jobs:
apt-get install -y libxml2-dev graphviz
- name: Build and Test
run: swift test -c release --enable-test-discovery

validate-assets:
runs-on: ubuntu-latest

name: "Validate Assets"

steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('.node/**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install node dependencies
run: |
cd .node
npm install
- name: Test assets
run: |
cd .node
OLD=`cksum ../Resources/all.min.css`
npm run build
NEW=`cksum ../Resources/all.min.css`
if [[ "$OLD" != "$NEW" ]]; then
echo "Regenerated assets differ from committed version"
exit -1
fi
3 changes: 2 additions & 1 deletion .node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"not dead"
],
"scripts": {
"watch": "postcss -w ../Assets/**/*.css -o ../Resources/all.min.css --config ./postcss.config.js"
"watch": "postcss -w ../Assets/**/*.css -o ../Resources/all.min.css --config ./postcss.config.js",
"build": "postcss ../Assets/**/*.css -o ../Resources/all.min.css --config ./postcss.config.js"
},
"dependencies": {
"cssnano": "^4.1.10",
Expand Down