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"
42 NPM_SCRIPT: "test:firefox"
45 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
47 - name: Use Node.js ${{ matrix.NODE_VERSION }}
48 uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
50 node-version: ${{ matrix.NODE_VERSION }}
53 uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
56 key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
58 ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-
60 - name: Install firefox ESR
62 export FIREFOX_SOURCE_URL='https://download.mozilla.org/?product=firefox-esr-latest-ssl&lang=en-US&os=linux64'
63 wget --no-verbose $FIREFOX_SOURCE_URL -O - | tar -jx -C ${HOME}
64 if: contains(matrix.NAME, 'Firefox ESR')
66 - name: Install dependencies
69 - name: Build All for Linting
70 run: npm run build:all
71 if: contains(matrix.NPM_SCRIPT, 'lint')
75 export PATH=${HOME}/firefox:$PATH
76 export FIREFOX_BIN=${HOME}/firefox/firefox
77 npm run ${{ matrix.NPM_SCRIPT }}
83 name: test:safari - Safari
86 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
88 - name: Use Node.js ${{ env.NODE_VERSION }}
89 uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
91 node-version: ${{ env.NODE_VERSION }}
94 uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
97 key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
99 ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
101 - name: Install dependencies
105 run: npm run test:safari