From 6826449015f1996f37718b770326310e2a2e24b6 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Mon, 22 Nov 2021 23:01:41 +0100 Subject: [PATCH 1/2] Build: Add GitHub Actions workflow file for Grunt tests Replaces Travis functionality. --- .github/workflows/test.yml | 50 ++++++++++++++++++++++++++++++++++++++ Gruntfile.js | 1 + 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000000..184864230c9 --- /dev/null +++ b/.github/workflows/test.yml @@ -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 + + diff --git a/Gruntfile.js b/Gruntfile.js index 68056aa61ec..402c30b750e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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" ] ); From e73861b5dc2e53a407b7ae2abc76f1d9a1b93ecd Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Tue, 23 Nov 2021 00:04:28 +0100 Subject: [PATCH 2/2] Travis: Remove obsolete configuration file Travis has been replaced with GitHub Actions. See 63c98b8542c765d289596642520f03d339949861 --- .npmignore | 1 - .travis.yml | 13 ------------- 2 files changed, 14 deletions(-) delete mode 100644 .travis.yml diff --git a/.npmignore b/.npmignore index 7ea325443a2..fc25be14136 100644 --- a/.npmignore +++ b/.npmignore @@ -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 index 988af22d76a..00000000000 --- a/.travis.yml +++ /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