Skip to content

Commit e23190e

Browse files
authored
Build: Migrate CI to GitHub Actions
Closes gh-4800
1 parent 9bdb16c commit e23190e

File tree

2 files changed

+73
-5
lines changed

2 files changed

+73
-5
lines changed

.github/workflows/node.js.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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: ES modules build, Chrome stable"
28+
NODE_VERSION: "16.x"
29+
NPM_SCRIPT: "test:esmodules"
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+
uses: actions/[email protected]
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 }}

Gruntfile.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ module.exports = function( grunt ) {
2222
var fs = require( "fs" ),
2323
gzip = require( "gzip-js" ),
2424
oldNode = /^v10\./.test( process.version ),
25-
isTravis = process.env.TRAVIS,
26-
travisBrowsers = process.env.BROWSERS && process.env.BROWSERS.split( "," );
25+
isCi = process.env.TRAVIS || process.env.GITHUB_ACTION,
26+
ciBrowsers = process.env.BROWSERS && process.env.BROWSERS.split( "," );
2727

2828
if ( !grunt.option( "filename" ) ) {
2929
grunt.option( "filename", "jquery.js" );
@@ -241,10 +241,10 @@ module.exports = function( grunt ) {
241241
singleRun: true
242242
},
243243
main: {
244-
browsers: isTravis && travisBrowsers || [ "ChromeHeadless", "FirefoxHeadless" ]
244+
browsers: isCi && ciBrowsers || [ "ChromeHeadless", "FirefoxHeadless" ]
245245
},
246246
esmodules: {
247-
browsers: isTravis && travisBrowsers || [ "ChromeHeadless" ],
247+
browsers: isCi && ciBrowsers || [ "ChromeHeadless" ],
248248
options: {
249249
client: {
250250
qunit: {
@@ -259,7 +259,7 @@ module.exports = function( grunt ) {
259259
}
260260
},
261261
amd: {
262-
browsers: isTravis && travisBrowsers || [ "ChromeHeadless" ],
262+
browsers: isCi && ciBrowsers || [ "ChromeHeadless" ],
263263
options: {
264264
client: {
265265
qunit: {

0 commit comments

Comments
 (0)