Skip to content

Commit e0a78d4

Browse files
authoredNov 30, 2021
Build: Switch from Travis to GitHub actions
Closes gh-2021
1 parent ed637b0 commit e0a78d4

File tree

4 files changed

+51
-14
lines changed

4 files changed

+51
-14
lines changed
 

‎.github/workflows/test.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Grunt tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
grunt:
7+
name: Grunt based tests with Node.js ${{ matrix.node-version }}
8+
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [12.x, 14.x]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
21+
- name: Get npm cache directory
22+
id: npm-cache-dir
23+
run: |
24+
echo "::set-output name=dir::$(npm config get cache)"
25+
26+
- name: Cache npm dependencies
27+
uses: actions/cache@v2
28+
with:
29+
path: ${{ steps.npm-cache-dir.outputs.dir }}
30+
key: ${{ runner.os }}-node-${{ matrix.node-version }}-npm-${{ hashFiles('**/package.json') }}
31+
restore-keys: |
32+
${{ runner.os }}-node-${{ matrix.node-version }}-npm-
33+
${{ runner.os }}-node-${{ matrix.node-version }}-
34+
${{ runner.os }}-node-
35+
${{ runner.os }}-
36+
37+
- name: Install npm dependencies
38+
run: npm install
39+
40+
# Keep these steps in sync with the default command tasks in our Gruntfile!
41+
- name: Run lint
42+
run: node_modules/.bin/grunt lint
43+
44+
- name: Run RequireJS
45+
run: node_modules/.bin/grunt requirejs
46+
47+
- name: Run Qunit
48+
run: node_modules/.bin/grunt test
49+
50+

‎.npmignore

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ tests
55
.eslintrc.json
66
.eslintignore
77
.mailmap
8-
.travis.yml
98
Gruntfile.js
109
.csslintrc
1110
.gitattributes

‎.travis.yml

-13
This file was deleted.

‎Gruntfile.js

+1
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ grunt.registerTask( "update-authors", function() {
490490
} );
491491
} );
492492

493+
// Keep this task list in sync with the testing steps in our GitHub action test workflow file!
493494
grunt.registerTask( "default", [ "lint", "requirejs", "test" ] );
494495
grunt.registerTask( "jenkins", [ "default", "concat" ] );
495496
grunt.registerTask( "lint", [ "asciilint", "eslint", "csslint", "htmllint" ] );

0 commit comments

Comments
 (0)
Please sign in to comment.