2021-11-30 22:56:39 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
# Node.js 10 is required by jQuery infra
|
2022-03-14 16:58:41 +00:00
|
|
|
# Do not remove 16.x until jsdom tests are re-enabled on newer Node.js versions.
|
2022-11-17 12:22:21 +00:00
|
|
|
NODE_VERSION: [10.x, 14.x, 16.x, 18.x, 19.x]
|
2021-11-30 22:56:39 +00:00
|
|
|
NPM_SCRIPT: ["test:browserless"]
|
|
|
|
include:
|
|
|
|
- NAME: "Browser tests: full build, Chrome & Firefox stable"
|
|
|
|
NODE_VERSION: "16.x"
|
|
|
|
NPM_SCRIPT: "test:browser"
|
|
|
|
BROWSERS: "ChromeHeadless,FirefoxHeadless"
|
|
|
|
- NAME: "Browser tests: slim build, Chrome stable"
|
|
|
|
NODE_VERSION: "16.x"
|
|
|
|
NPM_SCRIPT: "test:slim"
|
|
|
|
BROWSERS: "ChromeHeadless"
|
|
|
|
- NAME: "Browser tests: no-deprecated build, Chrome stable"
|
|
|
|
NODE_VERSION: "16.x"
|
|
|
|
NPM_SCRIPT: "test:no-deprecated"
|
|
|
|
BROWSERS: "ChromeHeadless"
|
|
|
|
- NAME: "Browser tests: ES modules build, Chrome stable"
|
|
|
|
NODE_VERSION: "16.x"
|
|
|
|
NPM_SCRIPT: "test:esmodules"
|
|
|
|
BROWSERS: "ChromeHeadless"
|
|
|
|
- NAME: "Browser tests: AMD build, Chrome stable"
|
|
|
|
NODE_VERSION: "16.x"
|
|
|
|
NPM_SCRIPT: "test:amd"
|
|
|
|
BROWSERS: "ChromeHeadless"
|
|
|
|
- NAME: "Browser tests: full build, Firefox ESR"
|
|
|
|
NODE_VERSION: "16.x"
|
|
|
|
NPM_SCRIPT: "test:browser"
|
|
|
|
BROWSERS: "FirefoxHeadless"
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-06-27 16:53:31 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-11-30 22:56:39 +00:00
|
|
|
|
|
|
|
- name: Cache
|
2022-06-27 16:53:31 +00:00
|
|
|
uses: actions/cache@v3
|
2021-11-30 22:56:39 +00:00
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-
|
|
|
|
|
|
|
|
- name: Use Node.js ${{ matrix.NODE_VERSION }}
|
2022-11-01 19:58:52 +00:00
|
|
|
uses: actions/setup-node@v3.5.1
|
2021-11-30 22:56:39 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.NODE_VERSION }}
|
|
|
|
|
|
|
|
- name: Install firefox ESR
|
|
|
|
run: |
|
|
|
|
export FIREFOX_SOURCE_URL='https://download.mozilla.org/?product=firefox-esr-latest&lang=en-US&os=linux64'
|
|
|
|
wget --no-verbose $FIREFOX_SOURCE_URL -O - | tar -jx -C ${HOME}
|
|
|
|
if: "contains(matrix.NAME, 'Firefox ESR')"
|
|
|
|
|
2022-01-04 15:27:42 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
npm install
|
|
|
|
|
|
|
|
- name: Run tests
|
2021-11-30 22:56:39 +00:00
|
|
|
env:
|
|
|
|
BROWSERS: ${{ matrix.BROWSERS }}
|
|
|
|
run: |
|
|
|
|
export PATH=${HOME}/firefox:$PATH
|
|
|
|
npm run ${{ matrix.NPM_SCRIPT }}
|