Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Setup code-coverage reporting for frontend packages (no-changelog) #5679

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: packages/cli/coverage/cobertura-coverage.xml,packages/nodes-base/coverage/cobertura-coverage.xml,packages/core/coverage/cobertura-coverage.xml,packages/workflow/coverage/cobertura-coverage.xml
files: packages/cli/coverage/cobertura-coverage.xml,packages/core/coverage/cobertura-coverage.xml,packages/design-system/coverage/cobertura-coverage.xml,packages/editor-ui/coverage/cobertura-coverage.xml,packages/nodes-base/coverage/cobertura-coverage.xml,packages/workflow/coverage/cobertura-coverage.xml
OlegIvaniv marked this conversation as resolved.
Show resolved Hide resolved

- name: Lint
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: packages/cli/coverage/cobertura-coverage.xml,packages/nodes-base/coverage/cobertura-coverage.xml,packages/core/coverage/cobertura-coverage.xml,packages/workflow/coverage/cobertura-coverage.xml
files: packages/cli/coverage/cobertura-coverage.xml,packages/core/coverage/cobertura-coverage.xml,packages/design-system/coverage/cobertura-coverage.xml,packages/editor-ui/coverage/cobertura-coverage.xml,packages/nodes-base/coverage/cobertura-coverage.xml,packages/workflow/coverage/cobertura-coverage.xml

lint:
name: Lint changes
Expand Down
6 changes: 3 additions & 3 deletions packages/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"clean": "rimraf dist .turbo",
"build": "vite build",
"typecheck": "vue-tsc --emitDeclarationOnly",
"test": "vitest run",
"test:ci": "vitest run --coverage",
"test": "vitest run --coverage",
"test:dev": "vitest",
"build:storybook": "storybook build",
"storybook": "storybook dev -p 6006",
Expand Down Expand Up @@ -54,6 +53,7 @@
"@types/markdown-it-emoji": "^2.0.2",
"@types/markdown-it-link-attributes": "^3.0.1",
"@types/sanitize-html": "^2.8.0",
"@vitest/coverage-c8": "^0.28.5",
"@vitejs/plugin-vue2": "^2.2.0",
"autoprefixer": "^10.4.13",
"c8": "7.12.0",
Expand All @@ -67,7 +67,7 @@
"storybook-addon-themes": "^6.1.0",
"trim": "^1.0.1",
"vite": "^4.0.4",
"vitest": "^0.28.4",
"vitest": "^0.28.5",
"vue-class-component": "^7.2.6",
"vue-loader": "^15.10.1",
"vue-property-decorator": "^9.1.2",
Expand Down
8 changes: 8 additions & 0 deletions packages/design-system/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';
import { defineConfig as defineVitestConfig } from 'vitest/config';

const { coverageReporters } = require('../../jest.config.js');

export default mergeConfig(
defineConfig({
plugins: [vue()],
Expand Down Expand Up @@ -38,6 +40,12 @@ export default mergeConfig(
globals: true,
environment: 'jsdom',
setupFiles: ['./src/__tests__/setup.ts'],
coverage: {
provider: 'c8',
reporter: coverageReporters,
include: ['src/**/*.ts'],
all: true,
},
css: {
modules: {
classNameStrategy: 'non-scoped',
Expand Down
6 changes: 3 additions & 3 deletions packages/editor-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"lintfix": "eslint --ext .js,.ts,.vue src --fix",
"format": "prettier --write . --ignore-path ../../.prettierignore",
"serve": "cross-env VUE_APP_URL_BASE_API=http://localhost:5678/ vite --host 0.0.0.0 --port 8080 dev",
"test": "vitest run",
"test:ci": "vitest run --coverage",
"test": "vitest run --coverage",
"test:dev": "vitest"
},
"dependencies": {
Expand Down Expand Up @@ -99,6 +98,7 @@
"@types/lodash.set": "^4.3.6",
"@types/luxon": "^2.0.9",
"@types/uuid": "^8.3.2",
"@vitest/coverage-c8": "^0.28.5",
"@vitejs/plugin-legacy": "^3.0.1",
"@vitejs/plugin-vue2": "^2.2.0",
"c8": "^7.12.0",
Expand All @@ -109,7 +109,7 @@
"string-template-parser": "^1.2.6",
"vite": "4.0.4",
"vite-plugin-monaco-editor": "^1.0.10",
"vitest": "^0.28.4",
"vitest": "^0.28.5",
"vue-tsc": "^1.0.24"
}
}
8 changes: 8 additions & 0 deletions packages/editor-ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { defineConfig as defineVitestConfig } from 'vitest/config';

import packageJSON from './package.json';

const { coverageReporters } = require('../../jest.config.js');

const vendorChunks = ['vue', 'vue-router'];
const n8nChunks = ['n8n-workflow', 'n8n-design-system'];
const ignoreChunks = [
Expand Down Expand Up @@ -118,6 +120,12 @@ export default mergeConfig(
globals: true,
environment: 'jsdom',
setupFiles: ['./src/__tests__/setup.ts'],
coverage: {
provider: 'c8',
reporter: coverageReporters,
include: ['src/**/*.ts'],
all: true,
},
css: {
modules: {
classNameStrategy: 'non-scoped',
Expand Down
114 changes: 80 additions & 34 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.