Skip to content

Commit

Permalink
Merge pull request #14594 from webpack/ci/node-17
Browse files Browse the repository at this point in the history
run CI on node 17
  • Loading branch information
sokra committed Oct 29, 2021
2 parents 1992e9c + c2b6f78 commit 42b4ffb
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/test.yml
Expand Up @@ -21,8 +21,8 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'yarn'
node-version: 17.x
cache: "yarn"
- run: yarn --frozen-lockfile
- uses: actions/cache@v1
with:
Expand All @@ -37,8 +37,8 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'yarn'
node-version: 17.x
cache: "yarn"
- run: yarn --frozen-lockfile
- run: yarn link --frozen-lockfile || true
- run: yarn link webpack --frozen-lockfile
Expand All @@ -54,8 +54,8 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'yarn'
node-version: 17.x
cache: "yarn"
- run: yarn --frozen-lockfile
- run: yarn link --frozen-lockfile || true
- run: yarn link webpack --frozen-lockfile
Expand All @@ -75,9 +75,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [10.x, 16.x]
node-version: [10.x, 17.x]
part: [a, b]
include:
- os: ubuntu-latest
node-version: 16.x
part: a
- os: ubuntu-latest
node-version: 14.x
part: a
Expand All @@ -91,7 +94,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache: "yarn"
- run: yarn --frozen-lockfile
- run: yarn link --frozen-lockfile || true
- run: yarn link webpack --frozen-lockfile
Expand Down
5 changes: 4 additions & 1 deletion test/WasmHashes.unittest.js
Expand Up @@ -15,7 +15,10 @@ const wasmHashes = {
const createMd4Hash = require("../lib/util/hash/md4");
return {
createHash: createMd4Hash,
createReferenceHash: async () => createHash("md4"),
createReferenceHash:
parseInt(process.version.slice(1), 10) < 17
? async () => createHash("md4")
: createMd4Hash,
regExp: /^[0-9a-f]{32}$/
};
}
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/StatsTestCases.basictest.js.snap
Expand Up @@ -952,9 +952,9 @@ webpack x.x.x compiled successfully in X ms"

exports[`StatsTestCases should print correct stats for exclude-with-loader 1`] = `
"hidden assets 34 bytes 1 asset
asset bundle.js 5.28 KiB [emitted] (name: main)
asset bundle.js 5.25 KiB [emitted] (name: main)
runtime modules 1.72 KiB 5 modules
hidden modules 123 bytes 2 modules
hidden modules 99 bytes 2 modules
cacheable modules 119 bytes
./index.js 77 bytes [built] [code generated]
./a.txt 42 bytes [built] [code generated]
Expand Down
3 changes: 3 additions & 0 deletions test/statsCases/exclude-with-loader/webpack.config.js
Expand Up @@ -18,6 +18,9 @@ module.exports = {
{
test: /\.json/,
loader: "file-loader",
options: {
name: "[sha256:hash:8].[ext]"
},
type: "javascript/auto"
}
]
Expand Down
5 changes: 2 additions & 3 deletions test/statsCases/real-content-hash/test.config.js
@@ -1,6 +1,6 @@
const fs = require("fs");
const path = require("path");
const crypto = require("crypto");
const createHash = require("../../../lib/util/createHash");

const hashedFiles = {
"file.jpg": a => a.name.endsWith(".jpg"),
Expand Down Expand Up @@ -31,8 +31,7 @@ module.exports = {
const asset = statsData.assets.find(hashedFiles[name]);
expect(asset).not.toBe(undefined);
const content = fs.readFileSync(path.resolve(__dirname, "a", name));
const hash = crypto
.createHash("md4")
const hash = createHash("md4")
.update(content)
.digest("hex")
.slice(0, 20);
Expand Down

0 comments on commit 42b4ffb

Please sign in to comment.