From 798cf247c37fb6f1b3c9384c6065d18dcfc8c5c0 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sat, 20 Feb 2021 11:42:57 +0100 Subject: [PATCH 1/2] chore: run lint in only one job --- .github/workflows/node.js.yml | 25 +++++++++++++++++++++++-- package.json | 5 ++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 7272fb1a..bdc96c01 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,7 +64,28 @@ 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: 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": [ From 4888400d9beee4bd556c19e7bf05f1759bf1879e Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sat, 20 Feb 2021 11:45:26 +0100 Subject: [PATCH 2/2] lint is needed --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index bdc96c01..8d525234 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -92,7 +92,7 @@ jobs: # 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