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']); };