Update Node Versions (for tests) (#3237)

* Update Node Versions (for tests)

- Move all test to a single file
- test on Node 20, 22 and 24 - on Windows and Ubuntu
- Sort `package.json` (with VS Code extension of this https://www.npmjs.com/package/sort-package-json)

* Update test.yml
This commit is contained in:
Christian Oliff
2025-06-04 18:30:00 +09:00
committed by GitHub
parent fdd2d89351
commit 9a9f4e1990
6 changed files with 30 additions and 57 deletions

View File

@@ -46,7 +46,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/
- name: publish npm
run: npm publish

View File

@@ -1,35 +0,0 @@
name: Build status (Windows)
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- name: Get npm cache directory
id: npm-cache
run: |
echo "dir=$(npm config get cache)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/checkout@v4
- name: Run tests ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test

View File

@@ -1,20 +1,26 @@
name: Build status (Ubuntu)
name: Build status
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18.x, 20.x]
node-version:
- 20
- 22
- 24
os: [ubuntu-latest, windows-latest]
steps:
- name: Get npm cache directory
id: npm-cache

View File

@@ -51,7 +51,8 @@ Our branch protection rules are as follows:
- In addition to the PR and approving reviewer, we require three status checks
to pass before code can be merged
_ Build with Node 20
_ Build with Node 18
_ Build with Node 22
_ Build with Node 24
- We _allow_ force pushes for project admins. While force pushes can create
some head scratching moments for people who have cloned the repo and update
before and after the force push, the ability to clean up the `HEAD` of a

3
package-lock.json generated
View File

@@ -26,8 +26,7 @@
"strip-json-comments": "^5.0.1"
},
"engines": {
"node": ">=18",
"npm": ">=10"
"node": ">=20"
}
},
"node_modules/@aashutoshrathi/word-wrap": {

View File

@@ -1,21 +1,28 @@
{
"name": "html5-boilerplate",
"version": "9.0.1",
"homepage": "https://html5boilerplate.com/",
"license": "MIT",
"description": "A professional front-end template for building fast, robust, and adaptable web apps or sites.",
"keywords": [
"h5bp",
"template",
"front-end"
],
"homepage": "https://html5boilerplate.com/",
"bugs": {
"url": "https://github.com/h5bp/html5-boilerplate/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/h5bp/html5-boilerplate.git"
},
"bugs": {
"url": "https://github.com/h5bp/html5-boilerplate/issues"
},
"license": "MIT",
"files": [
"CHANGELOG.md",
"LICENSE.txt",
"package.json",
"dist/",
"README.md"
],
"scripts": {
"build": "gulp build",
"prettier": "prettier --write ./**/*.{js,json,md,mjs,yml}",
@@ -39,8 +46,10 @@
"strip-json-comments": "^5.0.1"
},
"engines": {
"node": ">=18",
"npm": ">=10"
"node": ">=20"
},
"volta": {
"node": "20.19.1"
},
"h5bp-configs": {
"directories": {
@@ -49,12 +58,5 @@
"src": "src",
"test": "test"
}
},
"files": [
"CHANGELOG.md",
"LICENSE.txt",
"package.json",
"dist/",
"README.md"
]
}
}