-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Sass GitHub action to save built files #4929
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,14 @@ jobs: | |
run: | | ||
! grep "\$govuk-" .tmp/all.css | ||
|
||
- name: Save compiled Sass | ||
uses: actions/upload-artifact@v4.3.1 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: Dart Sass v1.0.0 output | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick Would have wanted to re-use the name of the job by looking in one of the contexts provided to the step... but couldn't find anything. If anyone knows how, would be keen to update. Don't think that's a blocker, though, more of a nice-to-have-if-we-know-how. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uploading the artefact is also very repetitive – we briefly explored running these using a matrix in #3030 but at the time it felt like it made the code too complicated. Wondering if that's worth revisiting. Equally with us dropping support for Ruby Sass and LibSass 'soon' maybe it's not worth spending any more time on this? 😕 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, thought there was a fair amount of repetitions and remembered Colin's attempt at having a matrix. Still not convinced we need to DRY things up with a matrix there given it's not that costly to add something 6 times and we don't touch those that often. Especially with the change of Sass compiler support at some point in the future. If for whatever reason we start bulking these workflows with more shared steps, we could revisit then. |
||
path: .tmp/all.css | ||
if-no-files-found: ignore | ||
|
||
dart-sass-latest: | ||
name: Dart Sass v1 (latest) | ||
runs-on: ubuntu-latest | ||
|
@@ -80,6 +88,14 @@ jobs: | |
run: | | ||
! grep "\$govuk-" .tmp/all.css | ||
|
||
- name: Save compiled Sass | ||
uses: actions/upload-artifact@v4.3.1 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: Dart Sass v1 (latest) output | ||
path: .tmp/all.css | ||
if-no-files-found: ignore | ||
|
||
# Node Sass v3.4.0 = LibSass v3.3.0 | ||
lib-sass: | ||
name: LibSass v3.3.0 (deprecated) | ||
|
@@ -110,6 +126,14 @@ jobs: | |
run: | | ||
! grep "\$govuk-" .tmp/all.css | ||
|
||
- name: Save compiled Sass | ||
uses: actions/upload-artifact@v4.3.1 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: LibSass v3.3.0 (deprecated) output | ||
path: .tmp/all.css | ||
if-no-files-found: ignore | ||
|
||
# Node Sass v8.x = LibSass v3 latest | ||
lib-sass-latest: | ||
name: LibSass v3 (latest, deprecated) | ||
|
@@ -140,6 +164,14 @@ jobs: | |
run: | | ||
! grep "\$govuk-" .tmp/all.css | ||
|
||
- name: Save compiled Sass | ||
uses: actions/upload-artifact@v4.3.1 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: LibSass v3 (latest, deprecated) output | ||
path: .tmp/all.css | ||
if-no-files-found: ignore | ||
|
||
ruby-sass: | ||
name: Ruby Sass v3.4.0 (deprecated) | ||
runs-on: ubuntu-latest | ||
|
@@ -168,6 +200,14 @@ jobs: | |
run: | | ||
! grep "\$govuk-" .tmp/all.css | ||
|
||
- name: Save compiled Sass | ||
uses: actions/upload-artifact@v4.3.1 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: Ruby Sass v3.4.0 (deprecated) output | ||
path: .tmp/all.css | ||
if-no-files-found: ignore | ||
|
||
ruby-sass-latest: | ||
name: Ruby Sass v3 (latest, deprecated) | ||
runs-on: ubuntu-latest | ||
|
@@ -195,3 +235,11 @@ jobs: | |
- name: Check output | ||
run: | | ||
! grep "\$govuk-" .tmp/all.css | ||
|
||
- name: Save compiled Sass | ||
uses: actions/upload-artifact@v4.3.1 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: Ruby Sass v3 (latest, deprecated) output | ||
path: .tmp/all.css | ||
if-no-files-found: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick Thinking we could add a
continue-on-error
to avoid that step failing the job if the upload has an issue. Thiscontinue-on-error
would have to be conditionned to the previous step being a success, though. Otherwise, I think it'd make test failures not fail the job.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to guard against the job being cancelled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following GitHub's recommendations to prefer
!cancelled()
toalways()
to ensure a step runs regardless of the previous steps. Made sense to me as if the job was cancelled, we don't care about uploading artifacts anyways. Happy to drop a comment on the first one to remind of GitHub's recommendations.