Skip to content

Commit e7a3eea

Browse files
committed
v6: Add CI for test coverage report & lint
1 parent eeadb21 commit e7a3eea

File tree

3 files changed

+54
-42
lines changed

3 files changed

+54
-42
lines changed

.github/workflows/ci-test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "CI: Test & Coverage"
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-and-test:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Node.js 20
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 22.17.1
17+
cache: "yarn" # Automatic caching for Yarn
18+
19+
- name: Install dependencies
20+
# --frozen-lockfile ensures yarn.lock is respected exactly
21+
run: yarn install --frozen-lockfile
22+
23+
- name: Run lint
24+
# This runs lint with eslint
25+
run: yarn lint
26+
27+
- name: Run tests and generate coverage
28+
# This runs vitest with coverage enabled
29+
run: yarn test:coverage
30+
31+
- name: Upload coverage to Coveralls
32+
uses: coverallsapp/github-action@v2
33+
with:
34+
# AUTOMATIC FOR PUBLIC REPOS:
35+
github-token: ${{ secrets.GITHUB_TOKEN }}
36+
37+
# REQUIRED FOR PRIVATE REPOS:
38+
# repo-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
39+
40+
# Optional: Explicitly point to the file if it's not found automatically
41+
path-to-lcov: ./coverage/lcov.info

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"homepage": "https://github.com/lotivo/sequelize-guard#readme",
3030
"engines": {
31-
"node": ">=20.19.0"
31+
"node": ">=22.17.1"
3232
},
3333
"main": "dist/index.js",
3434
"module": "dist/index.es.js",
@@ -51,8 +51,6 @@
5151
"test:watch": "vitest",
5252
"test:ui": "vitest --ui",
5353
"test:coverage": "vitest run --coverage",
54-
"cover": "nyc yarn test:coverage && nyc report --reporter=lcov --reporter=text-summary",
55-
"coverall": "nyc report --reporter=text-lcov | coveralls",
5654
"lint": "eslint .",
5755
"lint:fix": "eslint . --fix",
5856
"check:prettier": "prettier -c src/",
@@ -71,7 +69,6 @@
7169
"@typescript-eslint/parser": "^8.46.4",
7270
"@vitest/coverage-v8": "4.0.9",
7371
"@vitest/ui": "^4.0.9",
74-
"coveralls": "^3.1.1",
7572
"esdoc": "^1.1.0",
7673
"esdoc-standard-plugin": "^1.0.0",
7774
"eslint": "^9.39.1",
@@ -93,5 +90,8 @@
9390
"lodash": "^4.17.21",
9491
"node-cache": "^5.1.2",
9592
"sequelize": "^6.37.7"
93+
},
94+
"peerDependencies": {
95+
"sequelize": ">=6.0.0"
9696
}
9797
}

yarn.lock

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,18 +1193,18 @@ are-we-there-yet@^3.0.0:
11931193
delegates "^1.0.0"
11941194
readable-stream "^3.6.0"
11951195

1196-
argparse@^1.0.7, argparse@~1.0.9:
1196+
argparse@^2.0.1:
1197+
version "2.0.1"
1198+
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
1199+
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
1200+
1201+
argparse@~1.0.9:
11971202
version "1.0.10"
11981203
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
11991204
integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
12001205
dependencies:
12011206
sprintf-js "~1.0.2"
12021207

1203-
argparse@^2.0.1:
1204-
version "2.0.1"
1205-
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
1206-
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
1207-
12081208
array-buffer-byte-length@^1.0.1, array-buffer-byte-length@^1.0.2:
12091209
version "1.0.2"
12101210
resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz#384d12a37295aec3769ab022ad323a18a51ccf8b"
@@ -1729,17 +1729,6 @@ core-util-is@~1.0.0:
17291729
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
17301730
integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
17311731

1732-
coveralls@^3.1.1:
1733-
version "3.1.1"
1734-
resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.1.1.tgz#f5d4431d8b5ae69c5079c8f8ca00d64ac77cf081"
1735-
integrity sha512-+dxnG2NHncSD1NrqbSM3dn/lE57O6Qf/koe9+I7c+wzkqRmEvcp0kgJdxKInzYzkICKkFMZsX3Vct3++tsF9ww==
1736-
dependencies:
1737-
js-yaml "^3.13.1"
1738-
lcov-parse "^1.0.0"
1739-
log-driver "^1.2.7"
1740-
minimist "^1.2.5"
1741-
request "^2.88.2"
1742-
17431732
cross-spawn@^7.0.6:
17441733
version "7.0.6"
17451734
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"
@@ -2473,7 +2462,7 @@ espree@^10.0.1, espree@^10.4.0:
24732462
acorn-jsx "^5.3.2"
24742463
eslint-visitor-keys "^4.2.1"
24752464

2476-
esprima@^4.0.0, esprima@^4.0.1:
2465+
esprima@^4.0.1:
24772466
version "4.0.1"
24782467
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
24792468
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
@@ -3418,14 +3407,6 @@ js-tokens@^9.0.1:
34183407
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-9.0.1.tgz#2ec43964658435296f6761b34e10671c2d9527f4"
34193408
integrity sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==
34203409

3421-
js-yaml@^3.13.1:
3422-
version "3.14.2"
3423-
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.2.tgz#77485ce1dd7f33c061fd1b16ecea23b55fcb04b0"
3424-
integrity sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==
3425-
dependencies:
3426-
argparse "^1.0.7"
3427-
esprima "^4.0.0"
3428-
34293410
js-yaml@^4.1.0:
34303411
version "4.1.1"
34313412
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b"
@@ -3558,11 +3539,6 @@ kolorist@^1.8.0:
35583539
resolved "https://registry.yarnpkg.com/kolorist/-/kolorist-1.8.0.tgz#edddbbbc7894bc13302cdf740af6374d4a04743c"
35593540
integrity sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==
35603541

3561-
lcov-parse@^1.0.0:
3562-
version "1.0.0"
3563-
resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0"
3564-
integrity sha512-aprLII/vPzuQvYZnDRU78Fns9I2Ag3gi4Ipga/hxnVMCZC8DnR2nI7XBqrPoywGfxqIx/DgarGvDJZAD3YBTgQ==
3565-
35663542
levn@^0.4.1:
35673543
version "0.4.1"
35683544
resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"
@@ -3685,11 +3661,6 @@ lodash@^4.1.0, lodash@^4.15.0, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.2.0, l
36853661
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
36863662
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
36873663

3688-
log-driver@^1.2.7:
3689-
version "1.2.7"
3690-
resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8"
3691-
integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==
3692-
36933664
log-update@^6.1.0:
36943665
version "6.1.0"
36953666
resolved "https://registry.yarnpkg.com/log-update/-/log-update-6.1.0.tgz#1a04ff38166f94647ae1af562f4bd6a15b1b7cd4"
@@ -3831,7 +3802,7 @@ minimist@1.2.0:
38313802
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
38323803
integrity sha512-7Wl+Jz+IGWuSdgsQEJ4JunV0si/iMhg42MnQQG6h1R6TNeVenp4U9x5CC5v/gYqz/fENLQITAWXidNtVL0NNbw==
38333804

3834-
minimist@^1.1.0, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6:
3805+
minimist@^1.1.0, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.6:
38353806
version "1.2.8"
38363807
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
38373808
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
@@ -4448,7 +4419,7 @@ repeating@^2.0.0:
44484419
dependencies:
44494420
is-finite "^1.0.0"
44504421

4451-
request@^2.55.0, request@^2.88.2:
4422+
request@^2.55.0:
44524423
version "2.88.2"
44534424
resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3"
44544425
integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==

0 commit comments

Comments
 (0)