CI: test latest browsers without Browserstack, cache build step across jobs
This commit is contained in:
parent
b083e1d067
commit
18333999a2
2
.github/workflows/benchmark.yml
vendored
2
.github/workflows/benchmark.yml
vendored
|
@ -19,7 +19,7 @@ jobs:
|
|||
with:
|
||||
ref: main
|
||||
path: main
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/setup-node@v3
|
||||
|
||||
- name: Run pull request time benchmark
|
||||
run: cd pr && npm install && npm run --silent benchmark-time > benchmarks.txt && cat benchmarks.txt
|
||||
|
|
52
.github/workflows/browserstack.yml
vendored
52
.github/workflows/browserstack.yml
vendored
|
@ -1,52 +0,0 @@
|
|||
name: Test on Browserstack
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
full:
|
||||
name: Full Build
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: softprops/turnstyle@v1
|
||||
with:
|
||||
poll-interval-seconds: 30
|
||||
abort-after-seconds: 900
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: actions/setup-node@v2
|
||||
- run: npm ci
|
||||
- run: npm run build-test
|
||||
- run: npm run browserstack
|
||||
|
||||
lightweight:
|
||||
name: Lightweight Build
|
||||
|
||||
needs: full
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: softprops/turnstyle@v1
|
||||
with:
|
||||
poll-interval-seconds: 30
|
||||
abort-after-seconds: 900
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: actions/setup-node@v2
|
||||
- run: npm ci
|
||||
- run: npm run build-test --lightweight
|
||||
- run: npm run browserstack
|
||||
env:
|
||||
LIGHTWEIGHT: true
|
||||
|
||||
env:
|
||||
BROWSERSTACK_USERNAME: danielhuigens2
|
||||
BROWSERSTACK_KEY: aW2q1ms393QRorwBnfmW
|
4
.github/workflows/docs.yml
vendored
4
.github/workflows/docs.yml
vendored
|
@ -14,6 +14,6 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v2
|
||||
- run: npm ci
|
||||
- uses: actions/setup-node@v3
|
||||
- run: npm ci --ignore-scripts
|
||||
- run: npm run docs
|
||||
|
|
19
.github/workflows/lint.yml
vendored
19
.github/workflows/lint.yml
vendored
|
@ -1,19 +0,0 @@
|
|||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: ESLint
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v2
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
29
.github/workflows/node.js.yml
vendored
29
.github/workflows/node.js.yml
vendored
|
@ -1,29 +0,0 @@
|
|||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||
|
||||
name: Test on Node.js
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: ${{ matrix.node-version }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [14.x, 16.x, 18.x]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm ci
|
||||
- run: npm test
|
19
.github/workflows/test-type-definitions.yml
vendored
19
.github/workflows/test-type-definitions.yml
vendored
|
@ -1,19 +0,0 @@
|
|||
name: Types
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Test type definitions
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v2
|
||||
- run: npm ci
|
||||
- run: npm run test-type-definitions
|
186
.github/workflows/tests.yml
vendored
Normal file
186
.github/workflows/tests.yml
vendored
Normal file
|
@ -0,0 +1,186 @@
|
|||
name: Code Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build: # cache both dist and tests (non-lightweight only), based on commit hash
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- name: Check for cached folders
|
||||
id: cache-full
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
dist
|
||||
test/lib
|
||||
key: cache-${{ github.sha }}
|
||||
- name: Build dist and tests
|
||||
if: steps.cache-full.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npm ci
|
||||
npm run build-test
|
||||
|
||||
node:
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [14.x, 16.x, 18.x]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
name: Node ${{ matrix.node-version }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm ci --ignore-scripts # for mocha
|
||||
- name: Retrieve cached folders
|
||||
uses: actions/cache/restore@v3
|
||||
id: cache-full
|
||||
with:
|
||||
# test/lib is not needed, but the path must be specified fully for a cache-hit
|
||||
path: |
|
||||
dist
|
||||
test/lib
|
||||
key: cache-${{ github.sha }}
|
||||
# ignore cache miss, since it was taken care of the `build` step and it should never occur here
|
||||
- run: npm test
|
||||
|
||||
test-browsers-latest:
|
||||
name: Browsers (latest)
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
|
||||
- name: Retrieve cached built folders
|
||||
uses: actions/cache/restore@v3
|
||||
id: cache-full
|
||||
with:
|
||||
path: |
|
||||
dist
|
||||
test/lib
|
||||
key: cache-${{ github.sha }}
|
||||
|
||||
- name: Install dependencies
|
||||
# cannot use `--ignore-scripts` since playwright seems to use it to set ENV vars
|
||||
run: |
|
||||
npm pkg delete scripts.prepare
|
||||
npm ci
|
||||
|
||||
- name: Get Playwright version
|
||||
id: playwright-version
|
||||
run: |
|
||||
PLAYWRIGHT_VERSION=$(npm ls playwright | grep playwright | sed 's/.*@//')
|
||||
echo "version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
|
||||
- name: Check for cached browsers
|
||||
id: cache-playwright-browsers
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-browsers-${{ steps.playwright-version.outputs.version }}
|
||||
- name: Install browsers
|
||||
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npx playwright install-deps chrome
|
||||
npx playwright install-deps firefox
|
||||
|
||||
- name: Install WebKit # caching not possible, external shared libraries required
|
||||
run: npx playwright install-deps webkit
|
||||
|
||||
- name: Run browser tests
|
||||
run: npm run test-browser
|
||||
|
||||
- name: Run browser tests (lightweight) # overwrite test/lib
|
||||
run: |
|
||||
npm run build-test --lightweight
|
||||
npm run test-browser
|
||||
|
||||
test-browsers-compatibility:
|
||||
name: Browsers (older, on Browserstack)
|
||||
runs-on: ubuntu-latest
|
||||
needs: test-browsers-latest
|
||||
env: # credentials need hardcoding for now since Github secrets aren't accessible on pull requests from forks
|
||||
BROWSERSTACK_USERNAME: openpgpjs_PlY4Uq885CQ
|
||||
BROWSERSTACK_ACCESS_KEY: VjgBVRMxNVBj7SjJFiau
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
- name: Retrieve cached dist folder
|
||||
uses: actions/cache/restore@v3
|
||||
id: cache-full
|
||||
with:
|
||||
path: |
|
||||
dist
|
||||
test/lib
|
||||
key: cache-${{ github.sha }}
|
||||
|
||||
- name: Wait for other Browserstack tests to finish
|
||||
uses: softprops/turnstyle@v1
|
||||
with:
|
||||
poll-interval-seconds: 30
|
||||
abort-after-seconds: 900
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Run browserstack tests
|
||||
run: npm run test-browserstack
|
||||
|
||||
- name: Run browserstack tests (lightweight) # overwrite test/lib
|
||||
run: |
|
||||
npm run build-test --lightweight
|
||||
npm run test-browserstack
|
||||
env:
|
||||
LIGHTWEIGHT: true
|
||||
|
||||
types:
|
||||
name: Type definitions
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- run: npm ci --ignore-scripts # TS
|
||||
- name: Retrieve cached folders
|
||||
uses: actions/cache/restore@v3
|
||||
id: cache-full
|
||||
with:
|
||||
path: |
|
||||
dist
|
||||
test/lib
|
||||
key: cache-${{ github.sha }}
|
||||
- run: npm run test-type-definitions
|
||||
|
||||
lint:
|
||||
name: ESLint
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- run: npm ci --ignore-scripts # linter
|
||||
- name: Retrieve cached folders
|
||||
uses: actions/cache/restore@v3
|
||||
id: cache-full
|
||||
with:
|
||||
path: |
|
||||
dist
|
||||
test/lib
|
||||
key: cache-${{ github.sha }}
|
||||
- run: npm run lint
|
237
package-lock.json
generated
237
package-lock.json
generated
|
@ -39,10 +39,14 @@
|
|||
"http-server": "^0.12.3",
|
||||
"karma": "^6.4.0",
|
||||
"karma-browserstack-launcher": "^1.6.0",
|
||||
"karma-chrome-launcher": "^3.1.1",
|
||||
"karma-firefox-launcher": "^2.1.2",
|
||||
"karma-mocha": "^2.0.1",
|
||||
"karma-mocha-reporter": "^2.2.5",
|
||||
"karma-webkit-launcher": "^2.1.0",
|
||||
"mocha": "^8.4.0",
|
||||
"nyc": "^14.1.1",
|
||||
"playwright": "^1.30.0",
|
||||
"rollup": "^2.38.5",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"sinon": "^4.3.0",
|
||||
|
@ -1323,6 +1327,21 @@
|
|||
"fsevents": "~2.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/ci-info": {
|
||||
"version": "3.8.0",
|
||||
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz",
|
||||
"integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/sibiraj-s"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/circular-json": {
|
||||
"version": "0.3.3",
|
||||
"resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz",
|
||||
|
@ -3654,6 +3673,18 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-ci": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz",
|
||||
"integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ci-info": "^3.2.0"
|
||||
},
|
||||
"bin": {
|
||||
"is-ci": "bin.js"
|
||||
}
|
||||
},
|
||||
"node_modules/is-core-module": {
|
||||
"version": "2.10.0",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz",
|
||||
|
@ -3683,6 +3714,21 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-docker": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
|
||||
"integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"is-docker": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/is-extglob": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
|
||||
|
@ -3910,6 +3956,18 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-wsl": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
|
||||
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-docker": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
|
@ -4264,6 +4322,40 @@
|
|||
"karma": ">=0.9"
|
||||
}
|
||||
},
|
||||
"node_modules/karma-chrome-launcher": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.1.tgz",
|
||||
"integrity": "sha512-hsIglcq1vtboGPAN+DGCISCFOxW+ZVnIqhDQcCMqqCp+4dmJ0Qpq5QAjkbA0X2L9Mi6OBkHi2Srrbmm7pUKkzQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"which": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/karma-firefox-launcher": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-2.1.2.tgz",
|
||||
"integrity": "sha512-VV9xDQU1QIboTrjtGVD4NCfzIH7n01ZXqy/qpBhnOeGVOkG5JYPEm8kuSd7psHE6WouZaQ9Ool92g8LFweSNMA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-wsl": "^2.2.0",
|
||||
"which": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/karma-firefox-launcher/node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"isexe": "^2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"node-which": "bin/node-which"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/karma-mocha": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz",
|
||||
|
@ -4352,6 +4444,30 @@
|
|||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/karma-webkit-launcher": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/karma-webkit-launcher/-/karma-webkit-launcher-2.1.0.tgz",
|
||||
"integrity": "sha512-S5eqhH0DIcuJFi27nC6eBxZ3MTrPnYybPthDU2Q8dfG0yFrXx8FqNDKSbRZsFFvAKJ55QVtYH1bbArd3ddI5Sg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-ci": "^3.0.1",
|
||||
"uuid": "^9.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"playwright": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/karma-webkit-launcher/node_modules/uuid": {
|
||||
"version": "9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
|
||||
"integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/karma/node_modules/ansi-regex": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||
|
@ -6093,6 +6209,34 @@
|
|||
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/playwright": {
|
||||
"version": "1.30.0",
|
||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.30.0.tgz",
|
||||
"integrity": "sha512-ENbW5o75HYB3YhnMTKJLTErIBExrSlX2ZZ1C/FzmHjUYIfxj/UnI+DWpQr992m+OQVSg0rCExAOlRwB+x+yyIg==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"playwright-core": "1.30.0"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright-core": {
|
||||
"version": "1.30.0",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.30.0.tgz",
|
||||
"integrity": "sha512-7AnRmTCf+GVYhHbLJsGUtskWTE33SwMZkybJ0v6rqR1boxq2x36U7p1vDRV7HO2IwTZgmycracLxPEJI49wu4g==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/pluralize": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz",
|
||||
|
@ -9134,6 +9278,12 @@
|
|||
"readdirp": "~3.5.0"
|
||||
}
|
||||
},
|
||||
"ci-info": {
|
||||
"version": "3.8.0",
|
||||
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz",
|
||||
"integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==",
|
||||
"dev": true
|
||||
},
|
||||
"circular-json": {
|
||||
"version": "0.3.3",
|
||||
"resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz",
|
||||
|
@ -11005,6 +11155,15 @@
|
|||
"dev": true,
|
||||
"peer": true
|
||||
},
|
||||
"is-ci": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz",
|
||||
"integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ci-info": "^3.2.0"
|
||||
}
|
||||
},
|
||||
"is-core-module": {
|
||||
"version": "2.10.0",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz",
|
||||
|
@ -11025,6 +11184,12 @@
|
|||
"has-tostringtag": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"is-docker": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
|
||||
"integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
|
||||
"dev": true
|
||||
},
|
||||
"is-extglob": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
|
||||
|
@ -11189,6 +11354,15 @@
|
|||
"call-bind": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"is-wsl": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
|
||||
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-docker": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
|
@ -11633,6 +11807,36 @@
|
|||
"q": "~1.5.0"
|
||||
}
|
||||
},
|
||||
"karma-chrome-launcher": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.1.tgz",
|
||||
"integrity": "sha512-hsIglcq1vtboGPAN+DGCISCFOxW+ZVnIqhDQcCMqqCp+4dmJ0Qpq5QAjkbA0X2L9Mi6OBkHi2Srrbmm7pUKkzQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"which": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"karma-firefox-launcher": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-2.1.2.tgz",
|
||||
"integrity": "sha512-VV9xDQU1QIboTrjtGVD4NCfzIH7n01ZXqy/qpBhnOeGVOkG5JYPEm8kuSd7psHE6WouZaQ9Ool92g8LFweSNMA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-wsl": "^2.2.0",
|
||||
"which": "^2.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"karma-mocha": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz",
|
||||
|
@ -11707,6 +11911,24 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"karma-webkit-launcher": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/karma-webkit-launcher/-/karma-webkit-launcher-2.1.0.tgz",
|
||||
"integrity": "sha512-S5eqhH0DIcuJFi27nC6eBxZ3MTrPnYybPthDU2Q8dfG0yFrXx8FqNDKSbRZsFFvAKJ55QVtYH1bbArd3ddI5Sg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-ci": "^3.0.1",
|
||||
"uuid": "^9.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"uuid": {
|
||||
"version": "9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
|
||||
"integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"klaw": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz",
|
||||
|
@ -12895,6 +13117,21 @@
|
|||
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==",
|
||||
"dev": true
|
||||
},
|
||||
"playwright": {
|
||||
"version": "1.30.0",
|
||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.30.0.tgz",
|
||||
"integrity": "sha512-ENbW5o75HYB3YhnMTKJLTErIBExrSlX2ZZ1C/FzmHjUYIfxj/UnI+DWpQr992m+OQVSg0rCExAOlRwB+x+yyIg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"playwright-core": "1.30.0"
|
||||
}
|
||||
},
|
||||
"playwright-core": {
|
||||
"version": "1.30.0",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.30.0.tgz",
|
||||
"integrity": "sha512-7AnRmTCf+GVYhHbLJsGUtskWTE33SwMZkybJ0v6rqR1boxq2x36U7p1vDRV7HO2IwTZgmycracLxPEJI49wu4g==",
|
||||
"dev": true
|
||||
},
|
||||
"pluralize": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz",
|
||||
|
|
|
@ -44,7 +44,8 @@
|
|||
"start": "http-server",
|
||||
"prebrowsertest": "npm run build-test",
|
||||
"browsertest": "npm start -- -o test/unittests.html",
|
||||
"browserstack": "karma start test/karma.conf.js",
|
||||
"test-browser": "karma start test/karma.conf.js",
|
||||
"test-browserstack": "karma start test/karma.conf.js --browsers bs_safari_15,bs_ios_15,bs_safari_13_1",
|
||||
"coverage": "nyc npm test",
|
||||
"lint": "eslint .",
|
||||
"docs": "jsdoc --configure .jsdocrc.js --destination docs --recurse README.md src && printf '%s' 'docs.openpgpjs.org' > docs/CNAME",
|
||||
|
@ -80,10 +81,14 @@
|
|||
"http-server": "^0.12.3",
|
||||
"karma": "^6.4.0",
|
||||
"karma-browserstack-launcher": "^1.6.0",
|
||||
"karma-chrome-launcher": "^3.1.1",
|
||||
"karma-firefox-launcher": "^2.1.2",
|
||||
"karma-mocha": "^2.0.1",
|
||||
"karma-mocha-reporter": "^2.2.5",
|
||||
"karma-webkit-launcher": "^2.1.0",
|
||||
"mocha": "^8.4.0",
|
||||
"nyc": "^14.1.1",
|
||||
"playwright": "^1.30.0",
|
||||
"rollup": "^2.38.5",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"sinon": "^4.3.0",
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
/* eslint-disable no-process-env */
|
||||
const { chromium, firefox, webkit } = require('playwright');
|
||||
|
||||
process.env.CHROME_BIN = chromium.executablePath();
|
||||
process.env.FIREFOX_BIN = firefox.executablePath();
|
||||
process.env.WEBKIT_HEADLESS_BIN = webkit.executablePath();
|
||||
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
|
@ -14,12 +19,17 @@ module.exports = function(config) {
|
|||
frameworks: ['mocha'],
|
||||
|
||||
// plugins
|
||||
plugins: ['karma-mocha', 'karma-mocha-reporter', 'karma-browserstack-launcher'],
|
||||
plugins: [
|
||||
'karma-mocha',
|
||||
'karma-chrome-launcher',
|
||||
'karma-firefox-launcher',
|
||||
'karma-webkit-launcher',
|
||||
'karma-mocha-reporter',
|
||||
'karma-browserstack-launcher'
|
||||
],
|
||||
|
||||
client: {
|
||||
mocha: {
|
||||
reporter: 'html',
|
||||
ui: 'bdd',
|
||||
timeout: 30000,
|
||||
grep: process.env.LIGHTWEIGHT ? '@lightweight' : undefined
|
||||
}
|
||||
|
@ -76,7 +86,7 @@ module.exports = function(config) {
|
|||
|
||||
browserStack: {
|
||||
username: process.env.BROWSERSTACK_USERNAME,
|
||||
accessKey: process.env.BROWSERSTACK_KEY,
|
||||
accessKey: process.env.BROWSERSTACK_ACCESS_KEY,
|
||||
build: process.env.GITHUB_SHA,
|
||||
name: process.env.GITHUB_WORKFLOW,
|
||||
project: `openpgpjs/${process.env.GITHUB_EVENT_NAME || 'push'}${process.env.LIGHTWEIGHT ? '/lightweight' : ''}`,
|
||||
|
@ -85,24 +95,10 @@ module.exports = function(config) {
|
|||
|
||||
// define browsers
|
||||
customLaunchers: {
|
||||
bs_firefox_85: {
|
||||
base: 'BrowserStack',
|
||||
browser: 'Firefox',
|
||||
browser_version: '85.0',
|
||||
os: 'OS X',
|
||||
os_version: 'Big Sur'
|
||||
},
|
||||
bs_chrome_88: {
|
||||
base: 'BrowserStack',
|
||||
browser: 'Chrome',
|
||||
browser_version: '88.0',
|
||||
os: 'OS X',
|
||||
os_version: 'Big Sur'
|
||||
},
|
||||
bs_safari_14: {
|
||||
bs_safari_15: { // Webkit and Safari can differ in behavior
|
||||
base: 'BrowserStack',
|
||||
browser: 'Safari',
|
||||
browser_version: '14.0',
|
||||
browser_version: '15',
|
||||
os: 'OS X',
|
||||
os_version: 'Big Sur'
|
||||
},
|
||||
|
@ -113,12 +109,12 @@ module.exports = function(config) {
|
|||
os: 'OS X',
|
||||
os_version: 'Catalina'
|
||||
},
|
||||
bs_ios_14: {
|
||||
bs_ios_15: {
|
||||
base: 'BrowserStack',
|
||||
device: 'iPhone 12',
|
||||
device: 'iPhone 13',
|
||||
real_mobile: true,
|
||||
os: 'ios',
|
||||
os_version: '14'
|
||||
os_version: '15'
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -130,13 +126,7 @@ module.exports = function(config) {
|
|||
|
||||
// start these browsers
|
||||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
||||
browsers: [
|
||||
'bs_firefox_85',
|
||||
'bs_chrome_88',
|
||||
'bs_safari_13_1',
|
||||
'bs_safari_14',
|
||||
'bs_ios_14'
|
||||
],
|
||||
browsers: ['ChromeHeadless', 'FirefoxHeadless', 'WebkitHeadless'],
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, Karma captures browsers, runs the tests and exits
|
||||
|
|
Loading…
Reference in New Issue
Block a user