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"
43 - NAME: "Node 10 Build"
45 NPM_SCRIPT: "build:main"
48 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
50 - name: Use Node.js ${{ matrix.NODE_VERSION }}
51 uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
53 node-version: ${{ matrix.NODE_VERSION }}
56 uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
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: Install firefox ESR
65 export FIREFOX_SOURCE_URL='https://download.mozilla.org/?product=firefox-esr-latest-ssl&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: Build All for Linting
73 run: npm run build:all
74 if: contains(matrix.NPM_SCRIPT, 'lint')
78 export PATH=${HOME}/firefox:$PATH
79 export FIREFOX_BIN=${HOME}/firefox/firefox
80 npm run ${{ matrix.NPM_SCRIPT }}
86 name: test:safari - Safari
89 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
91 - name: Use Node.js ${{ env.NODE_VERSION }}
92 uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
94 node-version: ${{ env.NODE_VERSION }}
97 uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
100 key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
102 ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
104 - name: Install dependencies
108 run: npm run test:safari