Skip to content

Commit

Permalink
add lint grunt command with github actions for linting and build/publish
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasCARPi committed Nov 25, 2021
1 parent 4936bdf commit a15443f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: lint
on: [push, pull_request]
jobs:
run-lint:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '14', '16' ]
name: Node ${{ matrix.node }} test
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run lint
run: grunt lint
24 changes: 24 additions & 0 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: publish
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
name: Publish latest release
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '16.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build package
run: grunt build
- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 4 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,5 +288,8 @@ module.exports = function (grunt) {
grunt.registerTask('dist', ['build', 'compress', 'copy-docs']);

// Default task.
grunt.registerTask('default', ['build-css', 'build-js']);
grunt.registerTask('default', 'build');

// Linting
grunt.registerTask('lint', 'eslint');
};

0 comments on commit a15443f

Please sign in to comment.