]> source.dussan.org Git - jquery-ui.git/commitdiff
Build: Switch from Travis to GitHub actions
authorFelix Nagel <fnagel@users.noreply.github.com>
Tue, 30 Nov 2021 15:47:11 +0000 (16:47 +0100)
committerGitHub <noreply@github.com>
Tue, 30 Nov 2021 15:47:11 +0000 (16:47 +0100)
Closes gh-2021

.github/workflows/test.yml [new file with mode: 0644]
.npmignore
.travis.yml [deleted file]
Gruntfile.js

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644 (file)
index 0000000..1848642
--- /dev/null
@@ -0,0 +1,50 @@
+name: Grunt tests
+
+on: [push, pull_request]
+
+jobs:
+  grunt:
+    name: Grunt based tests with Node.js ${{ matrix.node-version }}
+
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        node-version: [12.x, 14.x]
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - uses: actions/setup-node@v1
+        with:
+          node-version: ${{ matrix.node-version }}
+
+      - name: Get npm cache directory
+        id: npm-cache-dir
+        run: |
+          echo "::set-output name=dir::$(npm config get cache)"
+
+      - name: Cache npm dependencies
+        uses: actions/cache@v2
+        with:
+          path: ${{ steps.npm-cache-dir.outputs.dir }}
+          key: ${{ runner.os }}-node-${{ matrix.node-version }}-npm-${{ hashFiles('**/package.json') }}
+          restore-keys: |
+            ${{ runner.os }}-node-${{ matrix.node-version }}-npm-
+            ${{ runner.os }}-node-${{ matrix.node-version }}-
+            ${{ runner.os }}-node-
+            ${{ runner.os }}-
+
+      - name: Install npm dependencies
+        run: npm install
+
+      #  Keep these steps in sync with the default command tasks in our Gruntfile!
+      - name: Run lint
+        run: node_modules/.bin/grunt lint
+
+      - name: Run RequireJS
+        run: node_modules/.bin/grunt requirejs
+
+      - name: Run Qunit
+        run: node_modules/.bin/grunt test
+
+
index 7ea325443a229b0223452e76a331e2a584fc78ad..fc25be14136c5285546797461a3762614bcb55c6 100644 (file)
@@ -5,7 +5,6 @@ tests
 .eslintrc.json
 .eslintignore
 .mailmap
-.travis.yml
 Gruntfile.js
 .csslintrc
 .gitattributes
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index 988af22..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-dist: bionic
-language: java
-jdk:
-  - openjdk8
-env:
-  - NODE_VERSION="10"
-  - NODE_VERSION="14"
-install:
-  - nvm install "$NODE_VERSION"
-  - npm install
-script:
-  - nvm use "$NODE_VERSION"
-  - npm test
index 68056aa61ec3882bcc68f89c917a5dd64c5011dc..402c30b750e67c8348812280742a4e70605bf423 100644 (file)
@@ -490,6 +490,7 @@ grunt.registerTask( "update-authors", function() {
        } );
 } );
 
+// Keep this task list in sync with the testing steps in our GitHub action test workflow file!
 grunt.registerTask( "default", [ "lint", "requirejs", "test" ] );
 grunt.registerTask( "jenkins", [ "default", "concat" ] );
 grunt.registerTask( "lint", [ "asciilint", "eslint", "csslint", "htmllint" ] );