From b8b3ba901226ae8dc138211e336bb6b82dad5e76 Mon Sep 17 00:00:00 2001 From: Christos Sidiropoulos Date: Wed, 22 Nov 2023 12:03:25 +0000 Subject: [PATCH] Add Grunt action Verifies compiled files are up to date Signed-off-by: Christos Sidiropoulos --- .github/workflows/npm-grunt.yml | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/npm-grunt.yml diff --git a/.github/workflows/npm-grunt.yml b/.github/workflows/npm-grunt.yml new file mode 100644 index 0000000..a07f907 --- /dev/null +++ b/.github/workflows/npm-grunt.yml @@ -0,0 +1,47 @@ +name: GruntComparison + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: npm + cache-dependency-path: './Build/package-lock.json' + + - name: Install and run Grunt + working-directory: ./Build + run: | + npm install -g grunt-cli + npm audit fix + echo "Running `grunt less`" + grunt less + echo "Running `grunt terser`" + grunt terser + + - name: Test for changes + working-directory: ./ + run: | + git diff -- ./Resources/Public/ + if [ -n "$(git status --porcelain -- ./Resources/Public/)" ]; then + echo "Changes detected in compiled files" + exit 1 + else + echo "No changes detected in compiled files" + fi