diff --git a/.github/workflows/node-tools-ci.yml b/.github/workflows/node-tools-ci.yml new file mode 100644 index 00000000..9728a8b3 --- /dev/null +++ b/.github/workflows/node-tools-ci.yml @@ -0,0 +1,33 @@ +name: Node Tools CI + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +concurrency: + group: wled-node-tools-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + node-tools: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Quality gate + run: npm run check diff --git a/package.json b/package.json index 8171059d..93aca1db 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,9 @@ }, "scripts": { "build": "node tools/cdata.js", + "lint": "node --check tools/cdata.js", + "test": "npm run build", + "check": "npm run lint && npm run test", "dev": "nodemon -e js,html,htm,css,png,jpg,gif,ico,js -w tools/ -w wled00/data/ -x node tools/cdata.js" }, "repository": {