Update code coverage tooling (#2751)

* try to update code coverage tooling

* split testing and coverage

* cleanups

* bump patched dependencies

* fix jsdoc errors

* undo node version bump

* cleanup gitignore

* fix script name
This commit is contained in:
Veeck
2024-10-16 16:15:21 +02:00
committed by GitHub
parent 44fa7b07c3
commit 275aa27c64
6 changed files with 505 additions and 367 deletions

26
.github/workflows/coverage.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Coverage
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Installing Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Installing dependencies
run: npm ci
- name: Installing gulp command line interface
run: npm install gulp-cli
- name: Run tests with coverage
run: npm run coverage:lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }} # required

View File

@@ -11,9 +11,9 @@ jobs:
node-version: [16.x, 18.x, 20.x]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Installing Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
@@ -21,7 +21,5 @@ jobs:
run: npm ci
- name: Installing gulp command line interface
run: npm install gulp-cli
- name: Testing Modernizr
- name: Run tests
run: npm test
- name: Sending Coverage
run: ./node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/codecov --pipe

3
.gitignore vendored
View File

@@ -1,8 +1,10 @@
/coverage
/dist
/gh-pages
/node_modules
/test/coverage
/test/*.html
/.nyc_output
modernizr.js
metadata.json
.DS_Store
@@ -10,4 +12,3 @@ metadata.json
.project
*.log
tmp
/.nyc_output

820
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -52,7 +52,7 @@
"lodash": "^4.17.21",
"markdown-it": "^13.0.1",
"mkdirp": "^3.0.1",
"requirejs": "^2.3.6",
"requirejs": "^2.3.7",
"yargs": "^17.7.2"
},
"devDependencies": {
@@ -73,23 +73,25 @@
"gulp-eslint": "^6.0.0",
"gulp-pug": "^5.0.0",
"joi": "^17.9.2",
"jquery": "^3.7.0",
"jquery": "^3.7.1",
"json3": "^3.3.3",
"mocha": "^10.2.0",
"mocha-headless-chrome": "^4.0.0",
"nyc": "^15.1.0",
"nyc": "^17.1.0",
"proxyquire": "^2.1.3",
"serve-static": "^1.15.0",
"sinon": "^15.2.0",
"ua-parser-js": "^1.0.35"
"ua-parser-js": "^1.0.39"
},
"scripts": {
"--- DEFAULT SCRIPTS ---": "",
"start": "gulp default",
"test": "nyc gulp test",
"test": "gulp test",
"--- GULP SCRIPTS ---": "",
"clean": "gulp clean",
"lint": "gulp eslint",
"coverage": "nyc gulp test",
"coverage:lcov": "nyc --reporter=lcov gulp test",
"--- MODERNIZR SCRIPTS ---": "",
"serve-gh-pages": "gulp serve:gh-pages",
"update-gh-pages": "scripts/generate-gh-pages.sh",

View File

@@ -1,9 +1,8 @@
define(function() {
/**
* is returns a boolean if the typeof an obj is exactly type.
*
* @access private
* @function is
* @function
* @param {*} obj - A thing we want to check the type of
* @param {string} type - A string to compare the typeof against
* @returns {boolean} true if the typeof the first parameter is exactly the specified type, false otherwise