@@ -632,7 +632,6 @@ jobs:
632632 uses : ./.github/actions/setup-chrome
633633 with :
634634 chrome-version : ' 145.0.7632.67'
635- runner-type : ' github-hosted'
636635
637636 - name : Use Node.js
638637 uses : actions/setup-node@v4
@@ -787,7 +786,6 @@ jobs:
787786 uses : ./.github/actions/setup-chrome
788787 with :
789788 chrome-version : ' 145.0.7632.67'
790- runner-type : ' github-hosted'
791789
792790 - name : Use Node.js
793791 uses : actions/setup-node@v4
@@ -916,7 +914,6 @@ jobs:
916914 uses : ./.github/actions/setup-chrome
917915 with :
918916 chrome-version : ' 145.0.7632.67'
919- runner-type : ' github-hosted'
920917
921918 - name : Use Node.js
922919 uses : actions/setup-node@v4
@@ -1069,3 +1066,221 @@ jobs:
10691066 pattern : accessibility-reports-*
10701067 delete-merged : true
10711068
1069+ csp-check-jquery :
1070+ name : CSP check (jQuery)
1071+ needs : [check-should-run, build-devextreme]
1072+ if : |
1073+ always() &&
1074+ needs.check-should-run.outputs.should-run == 'true' &&
1075+ needs.build-devextreme.result == 'success'
1076+ runs-on : devextreme-shr2
1077+ timeout-minutes : 60
1078+
1079+ steps :
1080+ - name : Get sources
1081+ uses : actions/checkout@v4
1082+
1083+ - name : Download artifacts
1084+ uses : actions/download-artifact@v4
1085+ with :
1086+ name : devextreme-artifacts-jquery
1087+ path : ./packages/devextreme
1088+
1089+ - name : Unpack artifacts
1090+ working-directory : ./packages/devextreme
1091+ run : 7z x artifacts.zip -aoa
1092+
1093+ - name : Setup Chrome
1094+ uses : ./.github/actions/setup-chrome
1095+ with :
1096+ chrome-version : ' 145.0.7632.67'
1097+
1098+ - name : Use Node.js
1099+ uses : actions/setup-node@v4
1100+ with :
1101+ node-version : ' 20'
1102+
1103+ - uses : pnpm/action-setup@v4
1104+ with :
1105+ run_install : false
1106+
1107+ - name : Get pnpm store directory
1108+ shell : bash
1109+ run : echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
1110+
1111+ - uses : actions/cache/restore@v4
1112+ name : Restore pnpm cache
1113+ with :
1114+ path : ${{ env.STORE_PATH }}
1115+ key : ${{ runner.os }}-pnpm-cache-${{ hashFiles('**/pnpm-lock.yaml') }}
1116+ restore-keys : |
1117+ ${{ runner.os }}-pnpm-cache
1118+
1119+ - name : Install dependencies
1120+ run : pnpm install --frozen-lockfile
1121+
1122+ - name : Start CSP Server
1123+ run : node apps/demos/utils/server/csp-server.js 8080 &
1124+
1125+ - name : Run CSP Check
1126+ working-directory : apps/demos
1127+ env :
1128+ CSP_FRAMEWORKS : jQuery
1129+ CHROME_PATH : google-chrome-stable
1130+ run : node utils/server/csp-check.js
1131+
1132+ - name : Upload CSP report
1133+ if : always()
1134+ uses : actions/upload-artifact@v4
1135+ with :
1136+ name : csp-violations-jquery
1137+ path : apps/demos/csp-reports/
1138+ if-no-files-found : ignore
1139+
1140+ csp-check-frameworks :
1141+ name : CSP check (${{ matrix.FRAMEWORK }})
1142+ needs : [check-should-run, determine-framework-tests-scope, build-devextreme]
1143+ if : |
1144+ always() &&
1145+ needs.check-should-run.outputs.should-run == 'true' &&
1146+ needs.determine-framework-tests-scope.result == 'success' &&
1147+ needs.determine-framework-tests-scope.outputs.framework-tests-scope != 'none' &&
1148+ needs.build-devextreme.result == 'success'
1149+ strategy :
1150+ fail-fast : false
1151+ matrix :
1152+ FRAMEWORK : [React, Vue, Angular]
1153+ runs-on : devextreme-shr2
1154+ timeout-minutes : 60
1155+
1156+ steps :
1157+ - name : Get sources
1158+ uses : actions/checkout@v4
1159+
1160+ - name : Download devextreme sources
1161+ uses : actions/download-artifact@v4
1162+ with :
1163+ name : devextreme-sources
1164+
1165+ - name : Setup Chrome
1166+ uses : ./.github/actions/setup-chrome
1167+ with :
1168+ chrome-version : ' 145.0.7632.67'
1169+
1170+ - name : Use Node.js
1171+ uses : actions/setup-node@v4
1172+ with :
1173+ node-version : ' 20'
1174+
1175+ - uses : pnpm/action-setup@v4
1176+ with :
1177+ run_install : false
1178+
1179+ - name : Get pnpm store directory
1180+ shell : bash
1181+ run : echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
1182+
1183+ - uses : actions/cache/restore@v4
1184+ name : Restore pnpm cache
1185+ with :
1186+ path : ${{ env.STORE_PATH }}
1187+ key : ${{ runner.os }}-pnpm-cache-${{ hashFiles('**/pnpm-lock.yaml') }}
1188+ restore-keys : |
1189+ ${{ runner.os }}-pnpm-cache
1190+
1191+ - name : Install dependencies
1192+ run : pnpm install --frozen-lockfile
1193+
1194+ - name : Install tgz
1195+ working-directory : apps/demos
1196+ run : pnpm add ../../devextreme-installer.tgz ../../devextreme-dist-installer.tgz ../../devextreme-react-installer.tgz ../../devextreme-vue-installer.tgz ../../devextreme-angular-installer.tgz
1197+
1198+ - name : Start CSP Server
1199+ run : node apps/demos/utils/server/csp-server.js 8080 &
1200+
1201+ - name : Run CSP Check
1202+ working-directory : apps/demos
1203+ env :
1204+ CSP_FRAMEWORKS : ${{ matrix.FRAMEWORK }}
1205+ CHROME_PATH : google-chrome-stable
1206+ run : node utils/server/csp-check.js
1207+
1208+ - name : Upload CSP report
1209+ if : always()
1210+ uses : actions/upload-artifact@v4
1211+ with :
1212+ name : csp-violations-${{ matrix.FRAMEWORK }}
1213+ path : apps/demos/csp-reports/
1214+ if-no-files-found : ignore
1215+
1216+ csp-report-summary :
1217+ name : CSP Violations Summary
1218+ runs-on : devextreme-shr2
1219+ needs : [check-should-run, csp-check-jquery, csp-check-frameworks]
1220+ if : always() && needs.check-should-run.outputs.should-run == 'true'
1221+ timeout-minutes : 5
1222+
1223+ steps :
1224+ - name : Get sources
1225+ uses : actions/checkout@v4
1226+
1227+ - name : Use Node.js
1228+ uses : actions/setup-node@v4
1229+ with :
1230+ node-version : ' 20'
1231+
1232+ - name : Download all CSP reports
1233+ uses : actions/download-artifact@v4
1234+ with :
1235+ pattern : csp-violations-*
1236+ path : csp-reports-all
1237+ merge-multiple : true
1238+ continue-on-error : true
1239+
1240+ - name : Summarize CSP violations
1241+ run : |
1242+ mkdir -p apps/demos/csp-reports
1243+
1244+ echo "## CSP Violations Report" >> $GITHUB_STEP_SUMMARY
1245+ echo '' >> $GITHUB_STEP_SUMMARY
1246+
1247+ GRAND_TOTAL=0
1248+ for report in csp-reports-all/csp-violations-*.jsonl; do
1249+ [ -f "$report" ] || continue
1250+ FRAMEWORK=$(basename "$report" | sed 's/csp-violations-//;s/\.jsonl//')
1251+ cp "$report" "apps/demos/csp-reports/"
1252+
1253+ if [ -s "$report" ]; then
1254+ COUNT=$(wc -l < "$report" | tr -d ' ')
1255+ GRAND_TOTAL=$((GRAND_TOTAL + COUNT))
1256+ echo "### ⚠️ ${FRAMEWORK}: ${COUNT} violation(s)" >> $GITHUB_STEP_SUMMARY
1257+ echo '' >> $GITHUB_STEP_SUMMARY
1258+ echo '<details>' >> $GITHUB_STEP_SUMMARY
1259+ echo '<summary>Show detailed report</summary>' >> $GITHUB_STEP_SUMMARY
1260+ echo '' >> $GITHUB_STEP_SUMMARY
1261+ echo '```' >> $GITHUB_STEP_SUMMARY
1262+ CSP_REPORT_FILE="$report" node apps/demos/utils/server/csp-report-summary.js >> $GITHUB_STEP_SUMMARY
1263+ echo '```' >> $GITHUB_STEP_SUMMARY
1264+ echo '' >> $GITHUB_STEP_SUMMARY
1265+ echo '</details>' >> $GITHUB_STEP_SUMMARY
1266+ echo '' >> $GITHUB_STEP_SUMMARY
1267+ else
1268+ echo "### ✅ ${FRAMEWORK}: No violations" >> $GITHUB_STEP_SUMMARY
1269+ echo '' >> $GITHUB_STEP_SUMMARY
1270+ fi
1271+ done
1272+
1273+ if [ "$GRAND_TOTAL" -eq 0 ]; then
1274+ echo "✅ No CSP violations detected across all frameworks."
1275+ else
1276+ echo "⚠️ Total: $GRAND_TOTAL CSP violation(s)"
1277+ fi
1278+
1279+ - name : Upload merged CSP reports
1280+ if : always()
1281+ uses : actions/upload-artifact@v4
1282+ with :
1283+ name : csp-violations-report
1284+ path : apps/demos/csp-reports/
1285+ if-no-files-found : ignore
1286+
0 commit comments