Skip to content

Commit

Permalink
Update Sass CLI tests to check for $govuk-* Sass variables
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Feb 20, 2024
1 parent da85187 commit 13365c6
Showing 1 changed file with 31 additions and 7 deletions.
38 changes: 31 additions & 7 deletions .github/workflows/sass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ jobs:
npm install -g sass@v1.0.0
sass --version
# Compile Sass and check for `$govuk-` in output
- name: Run command
run: time sass packages/govuk-frontend/src/govuk/all.scss > /dev/null
run: |
mkdir -p .tmp
time sass packages/govuk-frontend/src/govuk/all.scss > .tmp/all.css
grep --invert-match --null-data --quiet "\$govuk-" .tmp/all.css
dart-sass-latest:
name: Dart Sass v1 (latest)
Expand All @@ -62,9 +66,13 @@ jobs:
# warnings using the `quiet-deps` flag.
#
# Run the command through a shell to ensure `time` measures the time
# taken by the entire pipeline, as we are now piping input into `sass`.
# taken by the entire pipeline, as we are now piping input into `sass`,
# then check for `$govuk-` in output
- name: Run command
run: time sh -c 'echo "@import "\""govuk/all"\"";" | sass --stdin --quiet-deps --load-path=packages/govuk-frontend/src > /dev/null'
run: |
mkdir -p .tmp
time sh -c 'echo "@import "\""govuk/all"\"";" | sass --stdin --quiet-deps --load-path=packages/govuk-frontend/src > .tmp/all.css'
grep --invert-match --null-data --quiet "\$govuk-" .tmp/all.css
# Node Sass v3.4.0 = LibSass v3.3.0
lib-sass:
Expand All @@ -86,8 +94,12 @@ jobs:
npm install -g node-sass@v3.4.0
node-sass --version
# Compile Sass and check for `$govuk-` in output
- name: Run command
run: time node-sass packages/govuk-frontend/src/govuk/all.scss > /dev/null
run: |
mkdir -p
time node-sass packages/govuk-frontend/src/govuk/all.scss > .tmp/all.css
grep --invert-match --null-data --quiet "\$govuk-" .tmp/all.css
# Node Sass v8.x = LibSass v3 latest
lib-sass-latest:
Expand All @@ -109,8 +121,12 @@ jobs:
npm install -g node-sass@v8
node-sass --version
# Compile Sass and check for `$govuk-` in output
- name: Run command
run: time node-sass packages/govuk-frontend/src/govuk/all.scss > /dev/null
run: |
mkdir -p .tmp
time node-sass packages/govuk-frontend/src/govuk/all.scss > .tmp/all.css
grep --invert-match --null-data --quiet "\$govuk-" .tmp/all.css
ruby-sass:
name: Ruby Sass v3.4.0 (deprecated)
Expand All @@ -130,8 +146,12 @@ jobs:
gem install sass -v 3.4.0
sass --version
# Compile Sass and check for `$govuk-` in output
- name: Run command
run: time sass packages/govuk-frontend/src/govuk/all.scss > /dev/null
run: |
mkdir -p .tmp
time sass packages/govuk-frontend/src/govuk/all.scss > .tmp/all.css
grep --invert-match --null-data --quiet "\$govuk-" .tmp/all.css
ruby-sass-latest:
name: Ruby Sass v3 (latest, deprecated)
Expand All @@ -151,5 +171,9 @@ jobs:
gem install sass -v '~> 3.0'
sass --version
# Compile Sass and check for `$govuk-` in output
- name: Run command
run: time sass packages/govuk-frontend/src/govuk/all.scss > /dev/null
run: |
mkdir -p .tmp
time sass packages/govuk-frontend/src/govuk/all.scss > .tmp/all.css
grep --invert-match --null-data --quiet "\$govuk-" .tmp/all.css

0 comments on commit 13365c6

Please sign in to comment.