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:
parent
55f74bb863
commit
9232cbf8a7
@ -18,12 +18,14 @@ run_eslint() {
|
|||||||
local extra_args=ARGS_$1
|
local extra_args=ARGS_$1
|
||||||
local output_var=OUTPUT_$1
|
local output_var=OUTPUT_$1
|
||||||
local output=${!output_var}
|
local output=${!output_var}
|
||||||
|
local cache=.eslintcache-${1,,}
|
||||||
|
|
||||||
# ensure output exists even if eslint doesn't report any errors
|
# ensure output exists even if eslint doesn't report any errors
|
||||||
mkdir -p $(dirname $output)
|
mkdir -p $(dirname $output)
|
||||||
touch $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() {
|
list_commit_range_additions() {
|
||||||
|
Loading…
Reference in New Issue
Block a user