name: SCSS Compilation

on:
  pull_request:
    branches:
      - 'develop'
      - 'v4.x'
    paths:
      - '**.scss'
      - '**.css'
      - '.github/workflows/test-scss.yml'

  push:
    branches:
      - 'develop'
      - 'v4.x'
    paths:
      - '**.scss'
      - '**.css'
      - '.github/workflows/test-scss.yml'

jobs:
  build:
    name: Compilation of SCSS (Dart Sass)
    runs-on: ubuntu-20.04

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup Node
        uses: actions/setup-node@v2
        with:
          # node version based on dart-sass test workflow
          node-version: 16

      - name: Install Dart Sass
        run: |
          npm install --global sass
          sass --version

      - name: Run Dart Sass
        run: sass --no-source-map admin/css/debug-toolbar/toolbar.scss system/Debug/Toolbar/Views/toolbar.css

      - name: Check for changed CSS files
        run: |
          if [[ -n "$(git status --porcelain 2>/dev/null)" ]]; then
            echo "Your changes to the SCSS files did not match the expected CSS output."
            git diff-files --patch
            exit 1
          fi

Add workflow to test SCSS compilation
Add workflow to test SCSS compilation
