Skip to content

Commit

Permalink
all.bash: check that minified css files are unchanged
Browse files Browse the repository at this point in the history
Add a check that the minified css files correspond to the their sources.

Previously, the all.bash script generated the minified files and left
the modified files in the repo working copy. This may have helped during
development, but during CI it should be a no-op. This CL simply verifies
that. The developer can still run `devtools/cmd/static` manually.

A check like this should be standard procedure for all binary or
incrutable files that appear in CLs.

Change-Id: I47d34e5204637ff38113b91ff46c595b9f42f4ee
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/585476
kokoro-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
  • Loading branch information
jba committed May 16, 2024
1 parent 03e325a commit 7c9c894
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions all.bash
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ check_script_hashes() {
# run_build_static builds JavaScript output from TypeScript source files.
run_build_static() {
runcmd $GO run ./devtools/cmd/static
files=$(modified_files)
echo "mod: $files"
if [[ $(filter "$files" 'static/**/*.min*') != '' ]]; then
err "minimized CSS files are not consistent with unminimized ones; run ./devtools/cmd/static to regenerate them"
fi
}

run_npm() {
Expand Down

0 comments on commit 7c9c894

Please sign in to comment.