From ffd98a493bb7e3a8c5676cc7f371d3d206d69d09 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Tue, 10 Sep 2019 19:44:27 -0400 Subject: [PATCH] Add steps for linting, minification, start deployments The deployment step is not yet finished and this required splitting linting from running tests. --- .github/workflows/main.yml | 50 +++++++++++++++++++++++++++++++++++--- Gruntfile.js | 5 ++-- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 66096f5e..b247384a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,8 +3,8 @@ name: CI on: [push, pull_request] jobs: - tests: - name: "Tests" + linting: + name: Linting runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 @@ -12,7 +12,49 @@ jobs: uses: actions/setup-node@v1 with: node-version: 8 - - name: "npm install" + - name: npm install run: npm install - - name: "Run Grunt" + - name: Run linting + run: grunt compile lint + tests: + name: Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 8 + uses: actions/setup-node@v1 + with: + node-version: 8 + - name: npm install + run: npm install + - name: Run tests + run: grunt compile test + minification: + name: Minification + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 8 + uses: actions/setup-node@v1 + with: + node-version: 8 + - name: npm install + run: npm install + - name: Run minification + run: grunt compile minify + deploy: + name: Deploy + needs: [linting, tests, minification] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 8 + uses: actions/setup-node@v1 + with: + node-version: 8 + - name: npm install + run: npm install + - name: Run linting, tests, minify run: grunt + - name: Deploy to NPM + run: "echo 'We made it here'" diff --git a/Gruntfile.js b/Gruntfile.js index b4c4508a..23ef3d9c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -250,7 +250,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-sass'); - grunt.registerTask('default', ['compile', 'test', 'minify']); + grunt.registerTask('default', ['compile', 'test', 'lint', 'minify']); grunt.registerTask('compile', [ 'requirejs:dist', 'requirejs:dist.full', 'requirejs:i18n', @@ -258,5 +258,6 @@ module.exports = function (grunt) { 'sass:dev' ]); grunt.registerTask('minify', ['uglify', 'sass:dist']); - grunt.registerTask('test', ['connect:tests', 'qunit', 'jshint']); + grunt.registerTask('lint', ['jshint']); + grunt.registerTask('test', ['connect:tests', 'qunit']); };