diff --git a/.github/workflows/playwright-on-push-main.yml b/.github/workflows/playwright-on-push-main.yml index df71c61145..e30614c079 100644 --- a/.github/workflows/playwright-on-push-main.yml +++ b/.github/workflows/playwright-on-push-main.yml @@ -1,4 +1,4 @@ -name: Playwright-Chromium and firefox run full tests suite +name: On-Push-Main Chromium and firefox (Win/Mac/Linux) run full tests suite on: push: @@ -302,16 +302,17 @@ jobs: raiseIssue: needs: [ playwrightChromiumLinux, playwrightChromiumWindows, playwrightChromiumMacos, playwrightFirefoxLinux, playwrightFirefoxWindows, playwrightFirefoxMacos] runs-on: ubuntu-latest - if: always() # This ensures that this job runs even if the previous jobs failed + if: | + always() && ( # This ensures that this job runs even if the previous jobs failed + needs.playwrightChromiumLinux.result == 'failure' || + needs.playwrightChromiumWindows.result == 'failure' || + needs.playwrightChromiumMacos.result == 'failure' || + needs.playwrightFirefoxLinux.result == 'failure' || + needs.playwrightFirefoxWindows.result == 'failure' || + needs.playwrightFirefoxMacos.result == 'failure' + ) steps: - name: Check for failures and raise an issue - if: | - needs.playwrightChromiumLinux.result == 'failure' || - needs.playwrightChromiumWindows.result == 'failure' || - needs.playwrightChromiumMacos.result == 'failure' || - needs.playwrightFirefoxLinux.result == 'failure' || - needs.playwrightFirefoxWindows.result == 'failure' || - needs.playwrightFirefoxMacos.result == 'failure' uses: actions/github-script@v5 with: github-token: ${{secrets.GITHUB_TOKEN}} diff --git a/gulpfile.js/index.js b/gulpfile.js/index.js index cec0db335d..677aec4af6 100644 --- a/gulpfile.js/index.js +++ b/gulpfile.js/index.js @@ -400,10 +400,59 @@ function makeLoggerConfig() { }); } +function validatePackageVersions() { + return new Promise((resolve, reject)=>{ + const mainPackageJson = require("../package.json", "utf8"); + const nodePackageJson = require("../src-node/package.json", "utf8"); + if(nodePackageJson.devDependencies){ + reject("Node package json file(src-node/package.json) should not have any dev dependencies!"); + return; + } + const mainDevDeps = mainPackageJson.devDependencies, + mainDeps = mainPackageJson.dependencies, + nodeDeps = nodePackageJson.dependencies; + + // Create a merged list of all package names + const allPackages = new Set([ + ...Object.keys(mainDevDeps || {}), + ...Object.keys(mainDeps || {}), + ...Object.keys(nodeDeps || {}) + ]); + + let hasMismatch = false; + for (let packageName of allPackages) { + const mainDevVersion = mainDevDeps && mainDevDeps[packageName]; + const mainVersion = mainDeps && mainDeps[packageName]; + const nodeVersion = nodeDeps && nodeDeps[packageName]; + + if (mainDevVersion && mainVersion && mainDevVersion !== mainVersion) { + console.error(`Version mismatch for package ${packageName}: ${mainDevVersion} (package.json devDependencies) vs ${mainVersion} (package.json dependencies)`); + hasMismatch = true; + } + + if (mainDevVersion && nodeVersion && mainDevVersion !== nodeVersion) { + console.error(`Version mismatch for package ${packageName}: ${mainDevVersion} (package.json devDependencies) vs ${nodeVersion} (src-node/package.json dependencies)`); + hasMismatch = true; + } + + if (mainVersion && nodeVersion && mainVersion !== nodeVersion) { + console.error(`Version mismatch for package ${packageName}: ${mainVersion} (package.json dependencies) vs ${nodeVersion} (src-node/package.json dependencies)`); + hasMismatch = true; + } + } + + if (hasMismatch) { + reject("Package version mismatch detected. Check the errors above."); + } else { + resolve(); + } + }); +} + const createDistTest = series(copyDistToDistTestFolder, copyTestToDistTestFolder, copyIndexToDistTestFolder); exports.build = series(copyThirdPartyLibs.copyAll, makeLoggerConfig, zipDefaultProjectFiles, zipSampleProjectFiles, - createSrcCacheManifest); + createSrcCacheManifest, validatePackageVersions); exports.buildDebug = series(copyThirdPartyLibs.copyAllDebug, makeLoggerConfig, zipDefaultProjectFiles, zipSampleProjectFiles, createSrcCacheManifest); exports.clean = series(cleanDist); diff --git a/package.json b/package.json index 9c6897bfa6..47dd7e0f3f 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "@floating-ui/dom": "^0.5.4", "@fortawesome/fontawesome-free": "^6.1.2", "@highlightjs/cdn-assets": "^11.5.1", - "@phcode/fs": "^2.0.4", + "@phcode/fs": "^2.0.5", "@pixelbrackets/gfm-stylesheet": "^1.1.0", "@prettier/plugin-php": "0.18.9", "bootstrap": "^5.1.3", diff --git a/src-node/package-lock.json b/src-node/package-lock.json index 6994a6a342..689c6ef180 100644 --- a/src-node/package-lock.json +++ b/src-node/package-lock.json @@ -9,7 +9,7 @@ "version": "3.2.9-0", "license": "GNU-AGPL3.0", "dependencies": { - "@phcode/fs": "^2.0.4", + "@phcode/fs": "^2.0.5", "npm": "9.8.1" }, "engines": { @@ -17,9 +17,9 @@ } }, "node_modules/@phcode/fs": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@phcode/fs/-/fs-2.0.4.tgz", - "integrity": "sha512-410IOT5q78KSOJr+dlZ9zo1xw1dquTTQyPF/ui6jvI31T4PdSpwO0M0lgIlWOtug7P3guOQ1ymQwKLkaWO2/Ow==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@phcode/fs/-/fs-2.0.5.tgz", + "integrity": "sha512-M033f5MOtl391FfxRAfGI1DiNj0jUirUn46S6bMhZZRafFE+CYfUv6doPRPBoA/kL1ly28Lxh6bBekeJCJHKGg==", "dependencies": { "chokidar": "^3.5.3", "ignore": "^5.2.4", diff --git a/src-node/package.json b/src-node/package.json index aa664a75be..7b44bb8c22 100644 --- a/src-node/package.json +++ b/src-node/package.json @@ -19,7 +19,7 @@ }, "IMPORTANT!!": "Adding things here will bloat up the package size", "dependencies": { - "@phcode/fs": "^2.0.4", + "@phcode/fs": "^2.0.5", "npm": "9.8.1" } } \ No newline at end of file