Skip to content

Commit

Permalink
ABar
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoGurgel committed Dec 3, 2023
1 parent 3adf84c commit 7d89e40
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 26 deletions.
18 changes: 4 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Build
on:
push:
branches:
- main
- develop
- release-sonar
- release-retroativo1
pull_request:
types: [opened, synchronize, reopened]
jobs:
Expand All @@ -25,7 +27,7 @@ jobs:
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

test-e2e:
Expand All @@ -43,15 +45,3 @@ jobs:
docker-compose -f docker-compose.test.yml up -V --force-recreate --build --abort-on-container-exit --exit-code-from gerocuidado-usuario-api-test
env:
TEST: e2e
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
27 changes: 22 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"start:debug": "nest start --debug 0.0.0.0:7001 --watch --preserveWatchOutput",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest --no-cache --colors --detectOpenHandles",
"test:all": "CI=true npm run test -- --coverage",
"test": "jest --passWithNoTests --no-cache --runInBand --detectOpenHandles --coverage --colors",
"test:watch": "jest --watchAll",
"test:cov": "jest --runInBand --coverage --colors",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
Expand All @@ -27,6 +28,7 @@
"typeorm:migrate": "npm run typeorm migration:generate -- -d src/ormconfig.ts",
"typeorm:run": "./node_modules/.bin/typeorm-ts-node-commonjs migration:run -d src/ormconfig.ts",
"schema:drop": "npm run typeorm schema:drop",
"sonar": "sonar-scanner",
"schema:sync": "npm run typeorm schema:sync"
},
"dependencies": {
Expand Down Expand Up @@ -54,6 +56,7 @@
"dotenv": "10.0.0",
"express-actuator": "1.8.2",
"helmet": "6.0.0",
"jest-sonar-reporter": "^2.0.0",
"passport": "0.5.2",
"passport-jwt": "4.0.0",
"passport-local": "1.0.0",
Expand All @@ -76,7 +79,7 @@
"@types/cors": "2.8.12",
"@types/express": "4.17.13",
"@types/express-actuator": "1.8.0",
"@types/jest": "27.0.2",
"@types/jest": "^29.5.6",
"@types/node": "18.17.0",
"@types/passport-jwt": "3.0.6",
"@types/passport-local": "1.0.34",
Expand All @@ -88,12 +91,14 @@
"eslint-config-prettier": "8.4.0",
"eslint-plugin-prettier": "4.0.0",
"graphql": "16.6.0",
"jest": "27.5.1",
"jest": "^29.2.1",
"jest-mock-extended": "^3.0.5",
"jest-sonar": "^0.2.16",
"prettier": "2.5.1",
"sonarqube-scanner": "2.8.1",
"source-map-support": "0.5.21",
"supertest": "6.2.2",
"ts-jest": "27.1.3",
"ts-jest": "^29.1.1",
"ts-loader": "9.2.7",
"ts-node": "10.6.0",
"tsconfig-paths": "3.12.0",
Expand All @@ -115,9 +120,21 @@
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverage": true,
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"reporters": [
"default",
[
"jest-sonar",
{
"outputDirectory": "reports",
"outputName": "sonar-report.xml",
"relativeRootDir": "."
}
]
],
"coverageDirectory": "../coverage/unit",
"coveragePathIgnorePatterns": [
"src/migration",
Expand All @@ -133,4 +150,4 @@
],
"testEnvironment": "node"
}
}
}
14 changes: 7 additions & 7 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ sonar.organization=fga-eps-mds-1
sonar.projectName=2023-2-GEROcuidado-APIUsuario

sonar.host.url=https://sonarcloud.io
sonar.language=ts

sonar.sourceEncoding=UTF-8
sonar.python.version=3

sonar.sources=./src
sonar.inclusions=**
sonar.exclusions=**/main.ts,**/ormconfig.ts,**/*.module.ts,src/migration/*.ts,src/migrations.ts,**/*.spec.ts
sonar.sources=src
sonar.exclusions=**/main.ts,**/ormconfig.ts,**/*.module.ts,src/migration/*.ts,src/migrations.ts

sonar.javascript.lcov.reportPaths=./coverage/unit/lcov.info
sonar.dynamicAnalysis=reuseReports
sonar.core.codeCoveragePlugin=cobertura
sonar.javascript.lcov.reportPaths=coverage/unit/lcov.info

sonar.tests=src
sonar.test.inclusions=**/*.spec.ts
sonar.testExecutionReportPaths=reports/sonar-report.xml

0 comments on commit 7d89e40

Please sign in to comment.