[MM-62409] Generate and publish code coverage for webapp (#31144)

* Generate and publish code coverage for webapp

* Upate coverage output path

* Simplify coverage patterns

* Disable coverage file search

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Claudio Costa
2025-06-05 06:04:27 -06:00
коммит произвёл GitHub
родитель 50d81c2a38
Коммит 65c5f40c6a
5 изменённых файлов: 16 добавлений и 10 удалений

3
.github/codecov.yml поставляемый
Просмотреть файл

@@ -9,5 +9,8 @@ coverage:
project:
default:
threshold: 1.0
codecov:
notify:
after_n_builds: 2 # Server and webapp at this point
ignore:
- ^store/storetest.*

1
.github/workflows/webapp-ci-pr.yml поставляемый
Просмотреть файл

@@ -18,3 +18,4 @@ concurrency:
jobs:
pr-ci:
uses: ./.github/workflows/webapp-ci-template.yml
secrets: inherit

6
.github/workflows/webapp-ci-template.yml поставляемый
Просмотреть файл

@@ -75,6 +75,12 @@ jobs:
NODE_OPTIONS: --max_old_space_size=5120
run: |
npm run test-ci
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
files: ./webapp/channels/coverage/lcov.info
build:
runs-on: ubuntu-22.04

Просмотреть файл

@@ -8,15 +8,11 @@ const config = {
testPathIgnorePatterns: ['/node_modules/'],
clearMocks: true,
collectCoverageFrom: [
'actions/src/**/*.{js,jsx,ts,tsx}',
'client/src/**/*.{js,jsx,ts,tsx}',
'components/src/**/*.{jsx,tsx}',
'plugins/src/**/*.{js,jsx,ts,tsx}',
'reducers/src/**/*.{js,jsx,ts,tsx}',
'routes/src/**/*.{js,jsx,ts,tsx}',
'selectors/src/**/*.{js,jsx,ts,tsx}',
'stores/src/**/*.{js,jsx,ts,tsx}',
'utils/src/**/*.{js,jsx,ts,tsx}',
'src/**/*.{js,jsx,ts,tsx}',
],
coveragePathIgnorePatterns: [
'/node_modules/',
'mattermost-redux/src/selectors/create_selector',
],
coverageReporters: ['lcov', 'text-summary'],
fakeTimers: {

Просмотреть файл

@@ -192,7 +192,7 @@
"test:watch": "cross-env TZ=Etc/UTC jest --watch",
"test:updatesnapshot": "cross-env TZ=Etc/UTC jest --updateSnapshot",
"test:debug": "cross-env TZ=Etc/UTC jest --forceExit --detectOpenHandles --verbose",
"test-ci": "cross-env TZ=Etc/UTC jest --ci --maxWorkers=100%",
"test-ci": "cross-env TZ=Etc/UTC jest --ci --maxWorkers=100% --coverage",
"clean": "rm -rf dist node_modules .eslintcache .stylelintcache tsconfig.tsbuildinfo",
"stats": "cross-env NODE_ENV=production webpack --profile --json > webpack_stats.json",
"mmjstool": "mmjstool",