diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 309c003b..1b4c4795 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.node/package.json b/.node/package.json index 20b52bc2..cf48f847 100644 --- a/.node/package.json +++ b/.node/package.json @@ -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",