Skip to content

Commit d44147e

Browse files
authored
chore: run lint in only one job (#195)
1 parent 40a5b01 commit d44147e

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

.github/workflows/node.js.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
yarn
4444
yarn add --dev html-webpack-plugin@${{matrix.html-plugin-version }}
4545
- name: run tests
46-
run: yarn travis
46+
run: yarn cover
4747
- uses: codecov/codecov-action@v1
4848
if: ${{ matrix.html-plugin-version == 4 }}
4949
test-os:
@@ -71,14 +71,35 @@ jobs:
7171
node-version: 14.x
7272
- run: yarn
7373
- name: run tests
74-
run: yarn travis
74+
run: yarn cover
75+
lint:
76+
name: Run ESLint using Node.js LTS
77+
runs-on: ubuntu-latest
78+
79+
steps:
80+
- uses: actions/checkout@v2
81+
- name: Get yarn cache directory path
82+
id: yarn-cache-dir-path
83+
run: echo "::set-output name=dir::$(yarn cache dir)"
84+
- uses: actions/cache@v2
85+
id: yarn-cache
86+
with:
87+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
88+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
89+
restore-keys: |
90+
${{ runner.os }}-yarn-
91+
- uses: actions/[email protected]
92+
with:
93+
node-version: 14.x
94+
- run: yarn
95+
- run: yarn lint
7596

7697
release:
7798
if:
7899
# prettier-ignore
79100
${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
80101
name: Release new version
81-
needs: [test-node, test-os]
102+
needs: [lint, test-node, test-os]
82103
runs-on: ubuntu-latest
83104
steps:
84105
- uses: actions/checkout@v2

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"main": "lib/index.js",
1010
"scripts": {
1111
"clean": "del-cli lib/ coverage/ example/*/build example/*/dist",
12+
"prebuild": "npm run clean",
1213
"build": "babel src/ --out-dir lib/",
1314
"postbuild": "prettier lib/* --write",
1415
"cover": "jest --coverage",
@@ -21,9 +22,7 @@
2122
"build-and-update-license": "npm run build && npm run update-license",
2223
"prepublishOnly": "npm run build",
2324
"pretest": "npm run lint",
24-
"test": "jest",
25-
"pretravis": "npm run lint && npm run clean",
26-
"travis": "npm run cover"
25+
"test": "jest"
2726
},
2827
"repository": "SimenB/add-asset-html-webpack-plugin",
2928
"keywords": [

0 commit comments

Comments
 (0)