Skip to content

Commit

Permalink
💚 add GH workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ctcpip committed Feb 2, 2024
1 parent 691f47d commit da755d9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/security-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'jQuery Security Tests'

on: [pull_request, push, workflow_dispatch]

permissions:
contents: read

jobs:
test-security:
runs-on: ubuntu-latest
steps:
- uses: browser-actions/setup-chrome@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: npm ci
working-directory: security/server
- run: npm ci
working-directory: security/test
- run: npm test
working-directory: security/test
7 changes: 5 additions & 2 deletions security/test/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ const timeout = 5 * 1000;
let cmd;

if(platform === 'darwin'){
cmd = `"/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome" --headless=old --virtual-time-budget=${timeout} --run-all-compositor-stages-before-draw --dump-dom `;
cmd = `"/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome" `;
}
else {
// presume *nix
cmd = 'chrome ';
}

cmd += `--headless=old --virtual-time-budget=${timeout} --run-all-compositor-stages-before-draw --dump-dom `;

for (const v of jQueryVersions) {
try {
test(v);
Expand All @@ -46,7 +49,7 @@ function test(version, patched) {

console.log(`
--------------------------------------------------------------------------------
validating jQuery v${effectiveVersion}
validating jQuery v${effectiveVersion}
--------------------------------------------------------------------------------
`)

Expand Down

0 comments on commit da755d9

Please sign in to comment.