Skip to content

Commit fc038bf

Browse files
authored
[CI] Simplify test-and-fix script for build-dev workflow (#5568)
1 parent fc10be9 commit fc038bf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.github/workflows/build-dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
- run: npm run log:test-and-fix
3939
env:
40-
FIX_MOST_SKIP: i18n|refcache|submodule
40+
CMD_SKIP: i18n
4141
PIN_SKIP: ${{ inputs.submodule_path_regex }}
4242

4343
- uses: actions/upload-artifact@v4

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121
"_diff:fail": "git diff --name-only --exit-code || exit 1",
2222
"_fail": "exit 1",
2323
"_filename-error": "echo 'ERROR: the following files violate naming conventions; fix using: `npm run fix:filenames`'; echo; npm run -s _ls-bad-filenames; exit 1",
24-
"_fix:most": "npm run seq -- $(npm -s run _list:fix:* | grep -Ev \"${FIX_MOST_SKIP:-refcache|submodule}\")",
2524
"_get:no": "echo SKIPPING get operation",
2625
"_get:submodule": "set -x && git submodule update --init ${DEPTH:- --depth 999}",
2726
"_hugo": "hugo --cleanDestinationDir",
2827
"_install:dict": "npm install -D $(npm run -s _list:dict)",
2928
"_install:netlify-cli": "npm list netlify-cli || npm install -O netlify-cli",
3029
"_list:check:*": "npm run --loglevel=warn | grep -Ee '^\\s*check:[^:]+$'",
30+
"_list:check:for-test-and-fix": "npm -s run _list:check:* | grep -Ev \"${CMD_SKIP:-noop}\"",
3131
"_list:dict": "grep '^\\s*\"@cspell' package.json | awk -F: '{print $1}' | tr -d '\"'",
3232
"_list:fix:*": "npm run --loglevel=warn | grep -Ee '^\\s*fix:[^:]+$' | grep -v 'fix:all'",
33+
"_list:fix:for-test-and-fix": "npm -s run _list:fix:* | grep -Ev \"refcache|submodule|${CMD_SKIP:-noop}\"",
3334
"_ls-bad-filenames": "find assets content static -name '*_*' ! -name '[_.]*'",
3435
"_pin:submodule": "scripts/pin-submodules.pl",
3536
"_prebuild": "npm run seq -- get:submodule cp:spec",
@@ -97,7 +98,7 @@
9798
"serve:hugo": "npm run _serve:hugo -- --renderToMemory",
9899
"serve:netlify": "npm run _serve:netlify",
99100
"serve": "npm run serve:hugo --",
100-
"test-and-fix": "npm run seq -- fix:submodule _fix:most test",
101+
"test-and-fix": "npm run seq -- fix:submodule $(npm -s run _list:fix:for-test-and-fix) $(npm -s run _list:check:for-test-and-fix)",
101102
"test": "npm run check",
102103
"update:htmltest-config": "scripts/htmltest-config.sh",
103104
"update:pkg:hugo": "npm install --save-dev --save-exact hugo-extended@latest",

0 commit comments

Comments
 (0)