Skip to content

Commit b39cfa1

Browse files
ygj6mgol
authored andcommitted
Build: Migrate CI to GitHub Actions
Closes gh-4800 (cherry picked from commit e23190e)
1 parent 4bb7d06 commit b39cfa1

File tree

2 files changed

+72
-4
lines changed

2 files changed

+72
-4
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: 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+
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

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ module.exports = function( grunt ) {
1414

1515
var fs = require( "fs" ),
1616
gzip = require( "gzip-js" ),
17-
isTravis = process.env.TRAVIS,
18-
travisBrowsers = process.env.BROWSERS && process.env.BROWSERS.split( "," );
17+
isCi = process.env.TRAVIS || process.env.GITHUB_ACTION,
18+
ciBrowsers = process.env.BROWSERS && process.env.BROWSERS.split( "," );
1919

2020
if ( !grunt.option( "filename" ) ) {
2121
grunt.option( "filename", "jquery.js" );
@@ -223,10 +223,10 @@ module.exports = function( grunt ) {
223223
singleRun: true
224224
},
225225
main: {
226-
browsers: isTravis && travisBrowsers || [ "ChromeHeadless", "FirefoxHeadless" ]
226+
browsers: isCi && ciBrowsers || [ "ChromeHeadless", "FirefoxHeadless" ]
227227
},
228228
amd: {
229-
browsers: isTravis && travisBrowsers || [ "ChromeHeadless" ],
229+
browsers: isCi && ciBrowsers || [ "ChromeHeadless" ],
230230
options: {
231231
client: {
232232
qunit: {

0 commit comments

Comments
 (0)