From ecde64fa9ce3054329f7d05a9fa01366b0519991 Mon Sep 17 00:00:00 2001 From: Hardys Date: Wed, 17 Jun 2020 22:47:04 +0800 Subject: [PATCH] chore: add lint into github actions --- .github/workflows/nodejs.yml | 34 +++++++++++++++++++--------------- package.json | 4 ++-- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 86db7c3f..fdc5e11e 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -5,13 +5,16 @@ name: Node.js CI on: push: - branches: [ master ] + branches: [master] + paths-ignore: + - 'README.md' pull_request: - branches: [ master ] + branches: [master] + paths-ignore: + - 'README.md' jobs: build: - runs-on: ubuntu-latest strategy: @@ -19,15 +22,16 @@ jobs: node-version: [10.x, 12.x] steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci - - run: npm run build service-user - - run: npm run build service-account - - run: npm run build gateway - - run: npm test -- --passWithNoTests - env: - CI: true + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run lint + - run: npm run build service-user + - run: npm run build service-account + - run: npm run build gateway + - run: npm test -- --passWithNoTests + env: + CI: true diff --git a/package.json b/package.json index 0f382b4b..28b1dba1 100644 --- a/package.json +++ b/package.json @@ -7,12 +7,12 @@ "scripts": { "prebuild": "rimraf dist", "build": "nest build", - "format": "prettier --write \"apps/**/*.ts\" \"libs/**/*.ts\"", + "format": "prettier --write \"{apps,libs}/**/*.ts\"", "start": "nest start", "start:dev": "nest start --watch", "start:debug": "nest start --debug --watch", "start:prod": "node dist/main", - "lint": "eslint '{src,apps,libs,test}/**/*.ts' --fix", + "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --max-warnings 0", "test": "jest", "test:watch": "jest --watch", "test:cov": "jest --coverage",