|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + strategy: |
| 9 | + fail-fast: false |
| 10 | + matrix: |
| 11 | + # Node.js 10 is required by jQuery infra |
| 12 | + NODE_VERSION: [10.x, 12.x, 14.x, 16.x] |
| 13 | + NPM_SCRIPT: ["test:browserless"] |
| 14 | + include: |
| 15 | + - NAME: "Browser tests: full build, Chrome & Firefox stable" |
| 16 | + NODE_VERSION: "16.x" |
| 17 | + NPM_SCRIPT: "test:browser" |
| 18 | + BROWSERS: "ChromeHeadless,FirefoxHeadless" |
| 19 | + - NAME: "Browser tests: slim build, Chrome stable" |
| 20 | + NODE_VERSION: "16.x" |
| 21 | + NPM_SCRIPT: "test:slim" |
| 22 | + BROWSERS: "ChromeHeadless" |
| 23 | + - NAME: "Browser tests: no-deprecated build, Chrome stable" |
| 24 | + NODE_VERSION: "16.x" |
| 25 | + NPM_SCRIPT: "test:no-deprecated" |
| 26 | + BROWSERS: "ChromeHeadless" |
| 27 | + - NAME: "Browser tests: no-Sizzle build, Chrome stable" |
| 28 | + NODE_VERSION: "16.x" |
| 29 | + NPM_SCRIPT: "test:no-sizzle" |
| 30 | + BROWSERS: "ChromeHeadless" |
| 31 | + - NAME: "Browser tests: AMD build, Chrome stable" |
| 32 | + NODE_VERSION: "16.x" |
| 33 | + NPM_SCRIPT: "test:amd" |
| 34 | + BROWSERS: "ChromeHeadless" |
| 35 | + - NAME: "Browser tests: full build, Firefox ESR" |
| 36 | + NODE_VERSION: "16.x" |
| 37 | + NPM_SCRIPT: "test:browser" |
| 38 | + BROWSERS: "FirefoxHeadless" |
| 39 | + steps: |
| 40 | + - name: Checkout |
| 41 | + uses: actions/checkout@v2 |
| 42 | + |
| 43 | + - name: Cache |
| 44 | + uses: actions/cache@v2 |
| 45 | + with: |
| 46 | + path: ~/.npm |
| 47 | + key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }} |
| 48 | + restore-keys: | |
| 49 | + ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock- |
| 50 | +
|
| 51 | + - name: Use Node.js ${{ matrix.NODE_VERSION }} |
| 52 | + |
| 53 | + with: |
| 54 | + node-version: ${{ matrix.NODE_VERSION }} |
| 55 | + |
| 56 | + - name: Install firefox ESR |
| 57 | + run: | |
| 58 | + export FIREFOX_SOURCE_URL='https://download.mozilla.org/?product=firefox-esr-latest&lang=en-US&os=linux64' |
| 59 | + wget --no-verbose $FIREFOX_SOURCE_URL -O - | tar -jx -C ${HOME} |
| 60 | + if: "contains(matrix.NAME, 'Firefox ESR')" |
| 61 | + |
| 62 | + - name: Run test |
| 63 | + env: |
| 64 | + BROWSERS: ${{ matrix.BROWSERS }} |
| 65 | + run: | |
| 66 | + export PATH=${HOME}/firefox:$PATH |
| 67 | + npm install |
| 68 | + npm run ${{ matrix.NPM_SCRIPT }} |
0 commit comments