ci: upload test coverage results (#298)

Also rename the artifact storing all examples for clarity.
development
Thomas Bouffard 2023-12-29 07:24:34 +01:00 committed by GitHub
parent 7544da2da3
commit 728776b3e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 14 deletions

View File

@ -45,7 +45,12 @@ jobs:
- name: Build @maxgraph/core - esm - name: Build @maxgraph/core - esm
run: npm run build -w packages/core run: npm run build -w packages/core
- name: Test @maxgraph/core - name: Test @maxgraph/core
run: npm test -w packages/core run: npm test -w packages/core -- --coverage
- name: Upload test results as artifact
uses: actions/upload-artifact@v4
with:
name: test-coverage-${{runner.os}}-${{github.sha}}
path: packages/core/coverage/lcov-report
- name: Test TypeScript support - name: Test TypeScript support
run: npm test -w packages/ts-support run: npm test -w packages/ts-support
- name: Build ts-example - name: Build ts-example
@ -55,7 +60,7 @@ jobs:
- name: Upload all examples as artifact - name: Upload all examples as artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: bundles-test-results-${{runner.os}}-${{github.sha}} name: examples-${{runner.os}}-${{github.sha}}
path: | path: |
packages/html/dist/ packages/html/dist/
packages/ts-example/dist/ packages/ts-example/dist/

19
.gitignore vendored
View File

@ -1,24 +1,17 @@
node_modules
javascript/dist
.jshintrc .jshintrc
javascript/examples/**/dist
.idea/ .idea/
.vscode/
*.iml *.iml
.vscode/
dist dist
*.tgz *.tgz
# dependencies # dependencies
/node_modules node_modules/
/.pnp /.pnp
.pnp.js .pnp.js
# testing # testing
/coverage coverage/
# next.js
/.next/
/out/
# production # production
build/ build/
@ -38,6 +31,8 @@ yarn-error.log*
.env.test.local .env.test.local
.env.production.local .env.production.local
# vercel # vercel/next.js
.next/
.vercel .vercel
/src/.next/ src/.next/
out/

View File

@ -1,5 +1,7 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */ /** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = { module.exports = {
collectCoverageFrom: ['src/**/*.{ts,js}'],
coverageReporters: ['lcov', 'text-summary'],
// preset: 'ts-jest', // preset: 'ts-jest',
preset: 'ts-jest/presets/default-esm', preset: 'ts-jest/presets/default-esm',
testEnvironment: 'jsdom', // need to access to the browser objects testEnvironment: 'jsdom', // need to access to the browser objects