6 branches-ignore: "dependabot/**"
9 contents: read # to fetch code (actions/checkout)
13 runs-on: ubuntu-latest
17 # Node.js 10 is required by jQuery infra
18 # Do not remove 16.x until jsdom tests are re-enabled on newer Node.js versions.
19 NODE_VERSION: [10.x, 16.x, 18.x, 20.x]
20 NPM_SCRIPT: ["test:browserless"]
22 - NAME: "Browser tests: full build, Chrome, Firefox & WebKit"
24 NPM_SCRIPT: "test:browser"
25 BROWSERS: "ChromeHeadless,FirefoxHeadless,WebkitHeadless"
26 - NAME: "Browser tests: slim build, Chrome"
28 NPM_SCRIPT: "test:slim"
29 BROWSERS: "ChromeHeadless"
30 - NAME: "Browser tests: no-deprecated build, Chrome"
32 NPM_SCRIPT: "test:no-deprecated"
33 BROWSERS: "ChromeHeadless"
34 - NAME: "Browser tests: selector-native build, Chrome"
36 NPM_SCRIPT: "test:selector-native"
37 BROWSERS: "ChromeHeadless"
38 - NAME: "Browser tests: ES modules build, Chrome"
40 NPM_SCRIPT: "test:esmodules"
41 BROWSERS: "ChromeHeadless"
42 - NAME: "Browser tests: full build, Firefox ESR"
44 NPM_SCRIPT: "test:browser"
45 BROWSERS: "FirefoxHeadless"
48 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
51 uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
54 key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
56 ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-
58 - name: Use Node.js ${{ matrix.NODE_VERSION }}
59 uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
61 node-version: ${{ matrix.NODE_VERSION }}
63 - name: Install firefox ESR
65 export FIREFOX_SOURCE_URL='https://download.mozilla.org/?product=firefox-esr-latest&lang=en-US&os=linux64'
66 wget --no-verbose $FIREFOX_SOURCE_URL -O - | tar -jx -C ${HOME}
67 if: contains(matrix.NAME, 'Firefox ESR')
69 - name: Install dependencies
72 - name: Install Playwright dependencies
73 run: npx playwright-webkit install-deps
74 if: matrix.NPM_SCRIPT == 'test:browser' && contains(matrix.BROWSERS, 'WebkitHeadless')
77 run: npm run build:all && npm run lint
78 if: matrix.NODE_VERSION == '18.x'
82 BROWSERS: ${{ matrix.BROWSERS }}
84 export PATH=${HOME}/firefox:$PATH
85 npm run ${{ matrix.NPM_SCRIPT }}