diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 7272fb1a..8d525234 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -37,7 +37,7 @@ jobs: node-version: ${{ matrix.node-version }} - run: yarn - name: run tests - run: yarn travis + run: yarn cover - uses: codecov/codecov-action@v1 test-os: name: Test on ${{ matrix.os }} using Node.js LTS @@ -64,14 +64,35 @@ jobs: node-version: 14.x - run: yarn - name: run tests - run: yarn travis + run: yarn cover + lint: + name: Run ESLint using Node.js LTS + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - uses: actions/setup-node@v2.1.4 + with: + node-version: 14.x + - run: yarn + - run: yarn lint release: if: # prettier-ignore ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }} name: Release new version - needs: [test-node, test-os] + needs: [lint, test-node, test-os] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/package.json b/package.json index 85db646e..ce8b0117 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "main": "lib/index.js", "scripts": { "clean": "del-cli lib/ coverage/ example/*/build example/*/dist", + "prebuild": "npm run clean", "build": "babel src/ --out-dir lib/", "postbuild": "prettier lib/* --write", "cover": "jest --coverage", @@ -21,9 +22,7 @@ "build-and-update-license": "npm run build && npm run update-license", "prepublishOnly": "npm run build", "pretest": "npm run lint", - "test": "jest", - "pretravis": "npm run lint && npm run clean", - "travis": "npm run cover" + "test": "jest" }, "repository": "SimenB/add-asset-html-webpack-plugin", "keywords": [