Skip to content

Commit

Permalink
Add tests for Sass versions
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Feb 20, 2025
1 parent 956ebca commit a74cf47
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/sass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Sass

on: pull_request

jobs:
sass:
name: Dart Sass ${{ matrix.package-version }}
runs-on: ubuntu-22.04

strategy:
fail-fast: false

matrix:
package-version:
# Release without major deprecations
- 1.77.6

# Release with `mixed-decls` deprecated
- 1.77.7

# Release with `import` deprecated
- 1.80.0

# Dart Sass latest major version
- latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'npm'

- name: Install package
run: |
npm install -g sass@${{ matrix.package-version }}
sass --version
- name: Check compilation
run: |
mkdir -p .tmp
time sass packages/nhsuk.scss > .tmp/check.css
- name: Check load paths
run: |
mkdir -p .tmp
time sh -c 'echo "@import "\""nhsuk"\"";" | sass --stdin --load-path packages > .tmp/check1.css'
time sh -c 'echo "@forward "\""nhsuk"\"";" | sass --stdin --load-path packages > .tmp/check2.css'
time sh -c 'echo "@use "\""nhsuk"\"" as *;" | sass --stdin --load-path packages > .tmp/check3.css'
# Check output for uncompiled Sass
- name: Check output
run: |
! grep "\$nhsuk-" .tmp/check.css
! grep "\$nhsuk-" .tmp/check1.css
! grep "\$nhsuk-" .tmp/check2.css
! grep "\$nhsuk-" .tmp/check3.css

0 comments on commit a74cf47

Please sign in to comment.