Skip to content

Commit

Permalink
ci: Setup code-coverage reporting for frontend packages (no-changelog) (
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy authored Mar 14, 2023
1 parent a96861b commit eb3ba83
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 42 deletions.
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

- 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.

0 comments on commit eb3ba83

Please sign in to comment.