Skip to content

Commit cf66832

Browse files
committed
ci: update rollup and split build/test ci jobs
rollup didn't work anymore locally so I've updated it
1 parent 4521994 commit cf66832

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,34 @@ on:
55
pull_request:
66
branches: [master]
77
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
name: Build on Node.js 22
11+
steps:
12+
- name: Setup Node.js 22
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: 22
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Install dependencies
19+
run: npm install
20+
- name: Build
21+
run: npm run build
22+
- name: Upload build artifacts
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: build-artifacts
26+
path: |
27+
index.js
28+
lib/
29+
es/
30+
validator.js
31+
validator.min.js
32+
retention-days: 1
833
test:
934
runs-on: ubuntu-latest
35+
needs: build
1036
strategy:
1137
matrix:
1238
node-version: [22, 20, 18, 16, 14, 12, 10, 8]
@@ -21,7 +47,7 @@ jobs:
2147
- name: Install dependencies
2248
run: npm install --legacy-peer-deps
2349
- name: Run tests
24-
run: npm test
50+
run: npm test:ci
2551
- if: matrix.node-version == 22
2652
name: Send coverage info to Codecov
2753
uses: codecov/codecov-action@v5

build-browser.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import babelPresetEnv from "@babel/preset-env";
66
import pkg from "./package.json";
77

88
rollup({
9-
entry: "src/index.js",
9+
input: "src/index.js",
1010
plugins: [
1111
babel({
1212
presets: [[babelPresetEnv, { modules: false }]],
@@ -16,9 +16,9 @@ rollup({
1616
})
1717
.then((bundle) =>
1818
bundle.write({
19-
dest: "validator.js",
19+
file: "validator.js",
2020
format: "umd",
21-
moduleName: pkg.name,
21+
name: pkg.name,
2222
banner: `/*!\n${String(fs.readFileSync("./LICENSE"))
2323
.trim()
2424
.split("\n")

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"npm-run-all": "^4.1.5",
5050
"nyc": "^14.1.0",
5151
"rimraf": "^3.0.0",
52-
"rollup": "^0.47.0",
52+
"rollup": "^2.0.0",
5353
"rollup-plugin-babel": "^4.0.1",
5454
"timezone-mock": "^1.3.6",
5555
"uglify-js": "^3.0.19"
@@ -66,8 +66,9 @@
6666
"build:es": "babel src -d es --env-name=es",
6767
"build:node": "babel src -d .",
6868
"build": "run-p build:*",
69-
"pretest": "npm run build && npm run lint",
70-
"test": "nyc --reporter=cobertura --reporter=text-summary mocha --require @babel/register --reporter dot --recursive"
69+
"pretest": "npm run build && npm run lint:fix",
70+
"test": "npm run test",
71+
"test:ci": "nyc --reporter=cobertura --reporter=text-summary mocha --require @babel/register --reporter dot --recursive"
7172
},
7273
"engines": {
7374
"node": ">= 0.10"

0 commit comments

Comments
 (0)