-
Notifications
You must be signed in to change notification settings - Fork 365
100 lines (81 loc) · 2.56 KB
/
sass.yaml
File metadata and controls
100 lines (81 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Sass
on:
pull_request:
push:
branches:
- main
- 'feature/**'
- 'support/**'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: sass-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
dart-sass:
name: Dart Sass v1.79.0
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v6.0.2
- name: Setup Node.js
uses: actions/setup-node@v6.4.0
with:
cache: npm
node-version: 18 # Node.js 18 is the oldest supported by Dart Sass v1.79.0
- name: Install package
run: |
npm install -g sass@v1.79.0
sass --version
- name: Run command
run: |
mkdir -p .tmp
time sass packages/govuk-frontend/src/govuk/index.scss > .tmp/index.css
# Check output for uncompiled Sass
- name: Check output
run: |
! grep "\$govuk-" .tmp/index.css
- name: Save compiled Sass
uses: actions/upload-artifact@v7.0.1
if: ${{ !cancelled() }}
with:
name: Dart Sass v1.79.0 output
path: .tmp/index.css
if-no-files-found: ignore
dart-sass-latest:
name: Dart Sass v1 (latest)
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v6.0.2
- name: Setup Node.js
uses: actions/setup-node@v6.4.0
with:
cache: npm
node-version-file: .nvmrc # Node.js project version must support Dart Sass v1
- name: Install package
run: |
npm install -g sass@v1
sass --version
# Treat GOV.UK Frontend as a dependency by importing it via load paths,
# allowing us to mimic the way we recommend our users silence deprecation
# 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`.
- name: Run command
run: |
mkdir -p .tmp
time sh -c 'echo "@import "\""govuk/index"\"";" | sass --stdin --quiet-deps --load-path=packages/govuk-frontend/src > .tmp/index.css'
# Check output for uncompiled Sass
- name: Check output
run: |
! grep "\$govuk-" .tmp/index.css
- name: Save compiled Sass
uses: actions/upload-artifact@v7.0.1
if: ${{ !cancelled() }}
with:
name: Dart Sass v1 (latest) output
path: .tmp/index.css
if-no-files-found: ignore