diff --git a/.github/node.js.yml b/.github/node.js.yml new file mode 100644 index 0000000000000000000000000000000000000000..f2829a01bbd3565ded0ec2c7b94565066ca077da --- /dev/null +++ b/.github/node.js.yml @@ -0,0 +1,52 @@ +name: Node.js CI + +on: + pull_request: + branches: [ master ] + push: + branches: [ master ] +jobs: + test: + name: Test + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x, 14.x] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - run: npm ci + name: Install dependencies + - name: Test + run: npm test + lint: + name: Lint + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [14.x] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - run: npm ci + name: Install dependencies + - name: Lint + run: npm lint \ No newline at end of file diff --git a/package.json b/package.json index 2c70471bb79f91c0c8f1dbd114cd5292b46fc110..ac6d015928356de987f1de480181abbf7bcb8c58 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "scripts": { "start": "node app.js", "test": "mocha -r intelli-espower-loader -t 20000 app.test.js --exit", - "lint-fix": "eslint --fix --ext .js app.js module/ util/ test/ " + "lint": "eslint **/*.{js,ts}", + "lint-fix": "eslint --fix **/*.{js,ts}" }, "keywords": [ "网易云音乐",