Skip to content

Commit 4a31a1a

Browse files
authored
Merge branch 'main' into webpack5fix
2 parents 13335c8 + d44147e commit 4a31a1a

File tree

2 files changed

+35
-8
lines changed

2 files changed

+35
-8
lines changed

.github/workflows/node.js.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ on:
1010

1111
jobs:
1212
test-node:
13-
name: Test on Node.js v${{ matrix.node-version }}
13+
name:
14+
# prettier-ignore
15+
Test on Node.js v${{ matrix.node-version }} and html-webpack-plugin v${{ matrix.html-plugin-version }}
1416
strategy:
1517
fail-fast: false
1618
matrix:
1719
node-version: [6.x, 8.x, 10.x, 12.x, 14.x, 15.x]
20+
html-plugin-version: [3, 4]
1821
runs-on: ubuntu-latest
1922

2023
steps:
@@ -35,10 +38,14 @@ jobs:
3538
uses: actions/setup-node@v2
3639
with:
3740
node-version: ${{ matrix.node-version }}
38-
- run: yarn
41+
- name: install with html-webpack-plugin v${{matrix.html-plugin-version }}
42+
run: |
43+
yarn
44+
yarn add --dev html-webpack-plugin@${{matrix.html-plugin-version }}
3945
- name: run tests
40-
run: yarn travis
46+
run: yarn cover
4147
- uses: codecov/codecov-action@v1
48+
if: ${{ matrix.html-plugin-version == 4 }}
4249
test-os:
4350
name: Test on ${{ matrix.os }} using Node.js LTS
4451
strategy:
@@ -64,14 +71,35 @@ jobs:
6471
node-version: 14.x
6572
- run: yarn
6673
- name: run tests
67-
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
6896

6997
release:
7098
if:
7199
# prettier-ignore
72100
${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
73101
name: Release new version
74-
needs: [test-node, test-os]
102+
needs: [lint, test-node, test-os]
75103
runs-on: ubuntu-latest
76104
steps:
77105
- 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)