6 branches-ignore: "dependabot/**"
9 contents: read # to fetch code (actions/checkout)
13 runs-on: ubuntu-latest
14 name: ${{ matrix.NPM_SCRIPT }} - ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }})
19 NODE_VERSION: [18.x, 20.x, 22.x, 23.x]
20 NPM_SCRIPT: ["test:browserless"]
25 - NAME: "Chrome/Firefox"
27 NPM_SCRIPT: "test:browser"
30 NPM_SCRIPT: "test:slim"
33 NPM_SCRIPT: "test:no-deprecated"
36 NPM_SCRIPT: "test:selector-native"
39 NPM_SCRIPT: "test:esm"
40 - NAME: "Firefox ESR (new)"
42 NPM_SCRIPT: "test:firefox"
43 - NAME: "Firefox ESR (old)"
45 NPM_SCRIPT: "test:firefox"
48 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
50 - name: Use Node.js ${{ matrix.NODE_VERSION }}
51 uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
53 node-version: ${{ matrix.NODE_VERSION }}
56 uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
59 key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
61 ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-
63 - name: Set download URL for Firefox ESR (old)
65 echo "FIREFOX_SOURCE_URL=https://download.mozilla.org/?product=firefox-esr-latest-ssl&lang=en-US&os=linux64" >> "$GITHUB_ENV"
66 if: contains(matrix.NAME, 'Firefox ESR (old)')
68 - name: Set download URL for Firefox ESR (new)
70 echo "FIREFOX_SOURCE_URL=https://download.mozilla.org/?product=firefox-esr-next-latest-ssl&lang=en-US&os=linux64" >> "$GITHUB_ENV"
71 if: contains(matrix.NAME, 'Firefox ESR (new)')
73 - name: Install Firefox ESR
75 wget --no-verbose $FIREFOX_SOURCE_URL -O - | tar -jx -C ${HOME}
76 echo "PATH=${HOME}/firefox:$PATH" >> "$GITHUB_ENV"
77 echo "FIREFOX_BIN=${HOME}/firefox/firefox" >> "$GITHUB_ENV"
78 if: contains(matrix.NAME, 'Firefox ESR')
80 - name: Install dependencies
83 - name: Build All for Linting
84 run: npm run build:all
85 if: contains(matrix.NPM_SCRIPT, 'lint')
88 run: npm run ${{ matrix.NPM_SCRIPT }}
91 runs-on: windows-latest
97 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
99 - name: Use Node.js ${{ env.NODE_VERSION }}
100 uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
102 node-version: ${{ env.NODE_VERSION }}
105 uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
108 key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
110 ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
112 - name: Install dependencies
115 - name: Run tests in Edge in IE mode
119 runs-on: macos-latest
122 name: test:safari - Safari
125 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
127 - name: Use Node.js ${{ env.NODE_VERSION }}
128 uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
130 node-version: ${{ env.NODE_VERSION }}
133 uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
136 key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
138 ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
140 - name: Install dependencies
144 run: npm run test:safari