Skip to content

Commit

Permalink
feat: ignore files in CodeCov + UTs reporting (#2439)
Browse files Browse the repository at this point in the history
## Proposed change

Ignore generated files in CodeCov
Add badge with reports into readme.md
Report UT results to CodeCov

<!--
Please include a summary of the changes and the related issue.
Please also include relevant motivation and context.
-->

## Related issues

<!--
Please make sure to follow the [contribution
guidelines](https://github.com/amadeus-digital/Otter/blob/main/CONTRIBUTING.md)
-->

*- No issue associated -*

<!-- * 🐛 Fix #issue -->
<!-- * 🐛 Fix resolves #issue -->
<!-- * 🚀 Feature #issue -->
<!-- * 🚀 Feature resolves #issue -->
<!-- * :octocat: Pull Request #issue -->
  • Loading branch information
kpanot authored Nov 12, 2024
2 parents 7b2d5af + 9045e24 commit b16af53
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 8 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,19 @@ jobs:
with:
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
uses: codecov/test-results-action@9739113ad922ea0a9abb4b2c0f8bf6a4aa8ef820 # 1.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Publish tests reports
if: always()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: ut-reports-${{ matrix.os }}
path: |
apps/**/dist-test/ut-report.xml
packages/**/dist-test/ut-report.xml
tools/**/dist-test/ut-report.xml
apps/**/dist-test/junit.xml
packages/**/dist-test/junit.xml
tools/**/dist-test/junit.xml
lint:
runs-on: ubuntu-latest
steps:
Expand All @@ -98,9 +102,11 @@ jobs:
uses: ./tools/github-actions/setup
- name: Cache Eslint
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
env:
hash: ${{ hashFiles('yarn.lock') }}
with:
path: .cache/eslint
key: ${{ runner.os }}-eslint-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-eslint-${{ env.hash }}
restore-keys: |
${{ runner.os }}-eslint-${{ env.hash }}
${{ runner.os }}-eslint
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
[![Stable Version](https://img.shields.io/npm/v/@o3r/core?style=for-the-badge)](https://www.npmjs.com/package/@o3r/core)
[![Chrome Extension](https://img.shields.io/chrome-web-store/v/aejabgendbpckkdnjaphhlifbhepmbne?style=for-the-badge&label=Chrome%20Extension&color=%23F2C146)](https://chromewebstore.google.com/detail/otter-devtools/aejabgendbpckkdnjaphhlifbhepmbne)
[![VSCode Extension](https://img.shields.io/visual-studio-marketplace/v/AmadeusITGroup.otter-devtools?style=for-the-badge&label=VSCode%20Extension&color=%2352A6E7)](https://marketplace.visualstudio.com/items?itemName=AmadeusITGroup.otter-devtools)
[![downloads](https://img.shields.io/npm/dm/@o3r/core?style=for-the-badge)](https://www.npmjs.com/package/@o3r/core)
[![Downloads](https://img.shields.io/npm/dm/@o3r/core?style=for-the-badge)](https://www.npmjs.com/package/@o3r/core)

[![Build](https://img.shields.io/github/actions/workflow/status/AmadeusITGroup/otter/main.yml?branch=main&style=for-the-badge)](https://github.com/AmadeusITGroup/otter/actions/workflows/main.yml)
[![Coverage](https://img.shields.io/codecov/c/github/AmadeusITGroup/otter?style=for-the-badge)](https://app.codecov.io/gh/AmadeusITGroup/otter)
[![Bugs](https://img.shields.io/github/issues-search/AmadeusITGroup/otter?query=is:open%20is:issue%20label:bug&style=for-the-badge&label=Open%20Bugs&color=red
)](https://github.com/AmadeusITGroup/otter/issues?q=is:issue+is:open+label:bug)


The **Otter** project is a highly modular framework whose goal is to provide a common platform to accelerate and facilitate the development on Angular web applications.
Expand Down
44 changes: 44 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
codecov:
require_ci_to_pass: false

ignore:
# Package Manager files
- '.yarn/**/*'
- '.pnp.*'
- '.cache/**/*'
- 'tmp/**/*'
- '**/node_modules/**/*'

# Distribution folders
- 'packages/@*/*/dist/**/*'
- 'tools/@*/*/dist/**/*'
- 'apps/@*/*/dist/**/*'

# Generated files
- 'packages/@o3r-training/showcase-sdk/src/api/**/*'
- 'packages/@o3r-training/showcase-sdk/src/models/base/**/*'
- 'packages/@o3r-training/showcase-sdk/src/spec/**/*'
- 'tools/github-actions/*/packaged-action/**/*'

comment:
layout: "condensed_header, condensed_files, condensed_footer"
behavior: default
Expand All @@ -10,3 +29,28 @@ component_management:
statuses:
- type: project
target: auto

individual_components:
- component_id: otter
name: Otter Modules
paths:
- packages/@o3r/**
- component_id: otter-tools
name: Otter developer tools
paths:
- apps/chrome-devtools/**
- apps/github-cascading-app/**
- apps/intellij-extension/**
- apps/vscode-extension/**
- component_id: otter-github-actions
name: Otter Github shared Actions
paths:
- tools/github-actions/**
- component_id: training
name: Training modules
paths:
- packages/@o3r-training/**
- component_id: sdk
name: SDK Tooling
paths:
- packages/@ama-sdk/**
2 changes: 1 addition & 1 deletion jest.config.ut.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module.exports.getJestGlobalConfig = (rootDir) => {
coverageReporters: ['cobertura'],
reporters: [
'default',
['jest-junit', { outputDirectory: '<rootDir>/dist-test', outputName: 'ut-report.xml' }],
['jest-junit', { outputDirectory: '<rootDir>/dist-test', outputName: 'junit.xml', classNameTemplate: '{filepath}' }],
'github-actions'
],
rootDir,
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"specs"
],
"outputs": [
"{projectRoot}/dist-test/ut-report.xml",
"{projectRoot}/dist-test/junit.xml",
"{projectRoot}/coverage/cobertura-coverage.xml"
],
"options": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module.exports.getJestGlobalConfig = (rootDir) => {
],
reporters: [
'default',
['jest-junit', {outputDirectory: '<rootDir>/dist-test', outputName: 'ut-report.xml'}],
['jest-junit', {outputDirectory: '<rootDir>/dist-test', outputName: 'junit.xml'}],
'github-actions'
],
}
Expand Down

0 comments on commit b16af53

Please sign in to comment.