@@ -42,38 +42,47 @@ jobs:
42
42
43
43
- name : Build and validate the CDS extractor bundle
44
44
working-directory : extractors/cds/tools
45
- run : npm run bundle :validate
46
-
47
- - name : Check JS bundle size and properties
45
+ run : npm run build :validate
46
+
47
+ - name : Validate CDS extractor JS bundle and map files
48
48
working-directory : extractors/cds/tools
49
49
run : |
50
50
_bundle_file="dist/cds-extractor.bundle.js"
51
- # Test that bundle exists and get detailed info
51
+ _bundle_map_file="${_bundle_file}.map"
52
52
if [ -f "$_bundle_file" ]; then
53
- echo "✅ Bundle file exists"
54
-
55
- # Check if bundle has shebang
56
- if head -n 1 "${_bundle_file}" | grep -q "#!/usr/bin/env node"; then
57
- echo "✅ Bundle has Node.js shebang"
58
- else
59
- echo "⚠️ Bundle missing Node.js shebang"
60
- fi
61
-
62
- # Check if source map exists
63
- if [ -f "${_bundle_file}.map" ]; then
64
- echo "✅ Source map exists"
65
- else
66
- echo "⚠️ Source map not found"
67
- fi
53
+ echo "✅ Bundle file exists."
68
54
else
69
- echo "❌ Bundle file not found"
70
- exit 1
55
+ echo "❌ Bundle file not found."
56
+ exit 2
57
+ fi
58
+
59
+ if [ -f "$_bundle_map_file" ]; then
60
+ echo "✅ CDS extractor JS bundle source map file exists."
61
+ else
62
+ echo "❌ CDS extractor JS bundle source map file not found."
63
+ exit 3
64
+ fi
65
+
66
+ # Check if the built bundle and map files differ
67
+ # from the versions committed to git.
68
+ if git diff --exit-code "$_bundle_file" "$_bundle_map_file"; then
69
+ echo "✅ CDS JS bundle and map files match committed versions."
70
+ else
71
+ echo "❌ CDS JS bundle and/or map file(s) differ from committed version(s)."
72
+ echo "The built bundle and/or source map do not match the committed versions."
73
+ echo "Please rebuild the bundle and commit the changes:"
74
+ echo " cd extractors/cds/tools"
75
+ echo " npm install"
76
+ echo " npm run build:all"
77
+ echo " git add dist/cds-extractor.bundle.*"
78
+ echo " git commit -m 'Update CDS extractor dist bundle'"
79
+ exit 4
80
+ fi
81
+
82
+ # Check if bundle file starts with the expected shebang for `node`.
83
+ if head -n 1 "${_bundle_file}" | grep -q "#!/usr/bin/env node"; then
84
+ echo "✅ Bundle has Node.js shebang"
85
+ else
86
+ echo "❌ Bundle missing Node.js shebang"
87
+ exit 5
71
88
fi
72
-
73
- # - name: Upload bundle artifact
74
- # uses: actions/upload-artifact@v4
75
- # with:
76
- # name: cds-extractor-bundle
77
- # path: |
78
- # extractors/cds/tools/dist/cds-extractor.bundle.js
79
- # extractors/cds/tools/dist/cds-extractor.bundle.js.map
0 commit comments