Skip to content

Commit 1a13239

Browse files
committed
try simplified check-js-build step
1 parent 7c5c884 commit 1a13239

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

.github/workflows/check-js-build.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
echo "✅ Version number $JSPROJECT_VERSION in $PKGJSON_PATH matches version number $PYPROJECT_VERSION in $PYPROJECT_PATH"
2525
fi
2626
- name: Install Node
27-
uses: actions/setup-node@v2
27+
uses: actions/setup-node@v4
2828
with:
2929
node-version: '22'
3030

@@ -44,31 +44,18 @@ jobs:
4444
npm ls
4545
- name: Check JupyterLab build artifacts
4646
run: |
47-
# 1. Hash contents of all static files, sort by content hash
48-
find plotly/labextension/static -type f -exec sha256sum {} \; | awk '{print $1}' | sort > new_hashes.txt
49-
find plotly/labextension-tmp/static -type f -exec sha256sum {} \; | awk '{print $1}' | sort > old_hashes.txt
47+
# Compare the plotly/labextension and plotly/labextension-tmp directories
48+
diff -r --brief plotly/labextension/ plotly/labextension-tmp/ > labextension_diff.txt
5049
51-
# 2. Compare the sorted content hashes
52-
diff old_hashes.txt new_hashes.txt > content_diff.txt
53-
54-
# Remove the "load" line from both package.json files before comparing
55-
grep -v '"load": "static/' plotly/labextension/package.json > pkg1.json
56-
grep -v '"load": "static/' plotly/labextension-tmp/package.json > pkg2.json
57-
58-
# Compare stripped versions
59-
diff pkg1.json pkg2.json > package_json_diff.txt
60-
61-
# 5. Final check
62-
if [ -s content_diff.txt ] || [ -s package_json_diff.txt ]; then
50+
# Check for differences
51+
if [ -s labextension_diff.txt ]; then
6352
echo "❌ Build artifacts differ:"
6453
echo "--- Unexpected diffs ---"
65-
cat content_diff.txt
66-
echo "--- Unexpected package.json diffs ---"
67-
cat package_json_diff.txt
54+
cat labextension_diff.txt
6855
echo "Please replace the 'plotly/labextension' directory with the artifacts of this CI run."
6956
exit 1
7057
else
71-
echo "✅ Build artifacts match expected output (ignoring known 'load' hash in package.json)."
58+
echo "✅ Build artifacts match expected output"
7259
fi
7360
7461
- name: Store the build artifacts from plotly/labextension

0 commit comments

Comments
 (0)