Skip to content

Commit

Permalink
[CI] build-dev workflow: use PIN_SKIP (#5563)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Nov 8, 2024
1 parent 59ae71f commit 1d87449
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 21 deletions.
16 changes: 2 additions & 14 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ jobs:
- name: Create and use reduced-dependencies package.json
run: |
jq '.devDependencies |= with_entries(
select(.key | test("prefix|hugo|css"))
)
| del(.dependencies, .optionalDependencies)' \
jq 'del(.dependencies, .optionalDependencies)' \
package.json > tmp/package-min.json
cp tmp/package-min.json package.json
Expand All @@ -38,18 +35,9 @@ jobs:

- run: npm install --omit=optional

- name: Fetch all submodules at HEAD
run: npm run update:submodule

- name:
Revert to pinned versions of submodules except for
submodule_path_regex
run: npm run _pin -- ${{ inputs.submodule_path_regex }}

- run: npm run log:test-and-fix
continue-on-error: true
env:
GET: no
PIN_SKIP: ${{ inputs.submodule_path_regex }}

- uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: |
PR_ACTION=$(echo $COMMENT | grep -oP '/fix:\K\w+')
echo "Action is $PR_ACTION"
ACTION_NAMES="all|dict|filenames|format|i18n|markdown|refcache|submodules|text"
ACTION_NAMES="all|dict|filenames|format|i18n|markdown|refcache|submodules?|text"
if [[ ! "$PR_ACTION" =~ ^($ACTION_NAMES)$ ]]; then
echo "Invalid action name: $PR_ACTION"
echo "Action name should be one of: $ACTION_NAMES"
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
all|refcache)
npm install --omit=optional
;&
dict|filenames|format|markdown|submodules)
dict|filenames|format|markdown|submodule*)
npm run fix:$PR_ACTION
;;
esac
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"_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",
"_fix:most": "npm run all -- $(npm -s run _list:fix:* | grep -Ev 'refcache|submodule')",
"_get:no": "echo SKIPPING get operation",
"_get:submodule:non-lang": "npm run _get:submodule -- content-modules/opentelemetry-specification themes/docsy",
"_get:submodule": "set -x && git submodule update --init ${DEPTH:- --depth 999}",
"_hugo": "hugo --cleanDestinationDir",
"_install:dict": "npm install -D $(npm run -s _list:dict)",
Expand All @@ -32,7 +31,7 @@
"_list:dict": "grep '^\\s*\"@cspell' package.json | awk -F: '{print $1}' | tr -d '\"'",
"_list:fix:*": "npm run --loglevel=warn | grep -Ee '^\\s*fix:[^:]+$' | grep -v 'fix:all'",
"_ls-bad-filenames": "find assets content static -name '*_*' ! -name '[_.]*'",
"_pin": "scripts/pin-submodules.pl",
"_pin:submodule": "scripts/pin-submodules.pl",
"_prebuild": "npm run seq -- get:submodule cp:spec",
"_prepare:docsy": "cd themes/docsy && npm install",
"_prettier:any": "npx prettier --ignore-path ''",
Expand Down Expand Up @@ -71,7 +70,7 @@
"fix:i18n": "npm run fix:i18n:new",
"fix:markdown": "npm run check:markdown -- --fix",
"fix:refcache": "npm run check:links",
"fix:submodules": "npm run update:submodule && npm run _pin",
"fix:submodule": "npm run pin:submodule",
"fix:text": "npm run check:text -- --fix",
"fix": "npm run fix:all",
"format": "npm run _check:format -- --write && npm run _check:format:ja+zh -- --write",
Expand All @@ -81,13 +80,15 @@
"make:public": "make public ls-public",
"netlify-build:preview": "npm run seq -- build:preview diff:check",
"netlify-build:production": "npm run seq -- build:production diff:check",
"pin:submodule": "npm run _pin:submodule -- $PIN_SKIP",
"postfix:submodule": "git submodule",
"postget:submodule": "git submodule",
"prebuild:preview": "npm run _prebuild",
"prebuild:production": "npm run _prebuild",
"prebuild": "npm run _prebuild",
"precheck:links:internal": "npm run build && npm run update:htmltest-config",
"precheck:links": "npm run build && npm run update:htmltest-config",
"prefix:submodules": "npm run update:submodule",
"prefix:submodule": "npm run update:submodule",
"prepare": "npm run seq -- get:submodule _prepare:docsy",
"preserve:hugo": "npm run _prebuild",
"preserve:netlify": "npm run seq -- _prebuild _install:netlify-cli",
Expand All @@ -96,7 +97,7 @@
"serve:hugo": "npm run _serve:hugo -- --renderToMemory",
"serve:netlify": "npm run _serve:netlify",
"serve": "npm run serve:hugo --",
"test-and-fix": "npm run seq -- fix:submodules _fix:most test",
"test-and-fix": "npm run seq -- fix:submodule _fix:most test",
"test": "npm run check",
"update:htmltest-config": "scripts/htmltest-config.sh",
"update:pkg:hugo": "npm install --save-dev --save-exact hugo-extended@latest",
Expand Down

0 comments on commit 1d87449

Please sign in to comment.