node-sass.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: CSS (node-sass)
  2. on:
  3. push:
  4. branches-ignore:
  5. - "dependabot/**"
  6. pull_request:
  7. workflow_dispatch:
  8. env:
  9. FORCE_COLOR: 2
  10. NODE: 18
  11. permissions:
  12. contents: read
  13. jobs:
  14. css:
  15. runs-on: ubuntu-latest
  16. steps:
  17. - name: Clone repository
  18. uses: actions/checkout@v3
  19. with:
  20. persist-credentials: false
  21. - name: Set up Node.js
  22. uses: actions/setup-node@v3
  23. with:
  24. node-version: "${{ env.NODE }}"
  25. cache: npm
  26. - name: Install npm dependencies
  27. run: npm ci
  28. - name: Build CSS with node-sass
  29. run: |
  30. npx --package node-sass@latest node-sass --version
  31. npx --package node-sass@latest node-sass --include-path=node_modules --output-style expanded --source-map true --source-map-contents true --precision 6 src/scss/ -o dist-sass/css/
  32. ls -Al dist-sass/css
  33. # Check that there are no Sass variables (`$`)
  34. - name: Check built CSS files
  35. shell: bash
  36. run: |
  37. if [[ $(find dist-sass/css/ -name "*.css" | xargs grep -F "\$" | wc -l | bc) -eq 0 ]]; then
  38. echo "All good, no Sass variables found"
  39. exit 0
  40. else
  41. echo "Found Sass variables!"
  42. exit 1
  43. fi