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]
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@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
50 - name: Use Node.js ${{ matrix.NODE_VERSION }}
51 uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
53 node-version: ${{ matrix.NODE_VERSION }}
56 uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.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@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
99 - name: Use Node.js ${{ env.NODE_VERSION }}
100 uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
102 node-version: ${{ env.NODE_VERSION }}
105 uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.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@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
127 - name: Use Node.js ${{ env.NODE_VERSION }}
128 uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
130 node-version: ${{ env.NODE_VERSION }}
133 uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.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