ci: Cache eslint results

While this isn't useful during CI, it can provide a massive speed-up
when used locally.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1094
This commit is contained in:
Florian Müllner 2020-03-14 16:15:45 +01:00 committed by verdre
parent 55f74bb863
commit 9232cbf8a7

View File

@ -18,12 +18,14 @@ run_eslint() {
local extra_args=ARGS_$1
local output_var=OUTPUT_$1
local output=${!output_var}
local cache=.eslintcache-${1,,}
# ensure output exists even if eslint doesn't report any errors
mkdir -p $(dirname $output)
touch $output
eslint -f unix ${!extra_args} -o $output js subprojects/extensions-app/js
eslint -f unix --cache --cache-location $cache ${!extra_args} -o $output \
js subprojects/extensions-app/js
}
list_commit_range_additions() {