diff options
author | ygj6 <7699524+ygj6@users.noreply.github.com> | 2021-12-01 06:56:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-30 23:56:39 +0100 |
commit | e23190e63cb121da79b92e6641a81a44dcea9252 (patch) | |
tree | 685b5265a40880508bcac448b65cc7e7af7bdcc3 /.github/workflows/node.js.yml | |
parent | 9bdb16cd19097da67950a707baac3980bda873f3 (diff) | |
download | jquery-e23190e63cb121da79b92e6641a81a44dcea9252.tar.gz jquery-e23190e63cb121da79b92e6641a81a44dcea9252.zip |
Build: Migrate CI to GitHub Actions
Closes gh-4800
Diffstat (limited to '.github/workflows/node.js.yml')
-rw-r--r-- | .github/workflows/node.js.yml | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 000000000..7bf861798 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,68 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # Node.js 10 is required by jQuery infra + NODE_VERSION: [10.x, 12.x, 14.x, 16.x] + NPM_SCRIPT: ["test:browserless"] + include: + - NAME: "Browser tests: full build, Chrome & Firefox stable" + NODE_VERSION: "16.x" + NPM_SCRIPT: "test:browser" + BROWSERS: "ChromeHeadless,FirefoxHeadless" + - NAME: "Browser tests: slim build, Chrome stable" + NODE_VERSION: "16.x" + NPM_SCRIPT: "test:slim" + BROWSERS: "ChromeHeadless" + - NAME: "Browser tests: no-deprecated build, Chrome stable" + NODE_VERSION: "16.x" + NPM_SCRIPT: "test:no-deprecated" + BROWSERS: "ChromeHeadless" + - NAME: "Browser tests: ES modules build, Chrome stable" + NODE_VERSION: "16.x" + NPM_SCRIPT: "test:esmodules" + BROWSERS: "ChromeHeadless" + - NAME: "Browser tests: AMD build, Chrome stable" + NODE_VERSION: "16.x" + NPM_SCRIPT: "test:amd" + BROWSERS: "ChromeHeadless" + - NAME: "Browser tests: full build, Firefox ESR" + NODE_VERSION: "16.x" + NPM_SCRIPT: "test:browser" + BROWSERS: "FirefoxHeadless" + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Cache + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock- + + - name: Use Node.js ${{ matrix.NODE_VERSION }} + uses: actions/setup-node@v2.1.2 + with: + node-version: ${{ matrix.NODE_VERSION }} + + - name: Install firefox ESR + run: | + export FIREFOX_SOURCE_URL='https://download.mozilla.org/?product=firefox-esr-latest&lang=en-US&os=linux64' + wget --no-verbose $FIREFOX_SOURCE_URL -O - | tar -jx -C ${HOME} + if: "contains(matrix.NAME, 'Firefox ESR')" + + - name: Run test + env: + BROWSERS: ${{ matrix.BROWSERS }} + run: | + export PATH=${HOME}/firefox:$PATH + npm install + npm run ${{ matrix.NPM_SCRIPT }} |