Skip to content

Commit

Permalink
Merge pull request #6 from fga-eps-mds/teste/sonar_cloud
Browse files Browse the repository at this point in the history
Teste/sonar cloud
  • Loading branch information
GustavoAPS authored Nov 1, 2023
2 parents b511b4e + 743f8f2 commit a483a32
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 5 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
test-unit:
name: Test Unit & Scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Test Unit
id: test-unit
run: |
docker-compose -f docker-compose.test.yml up -V --force-recreate --build --abort-on-container-exit --exit-code-from gerocuidado-saude-api-test
env:
TEST: unit

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

test-e2e:
name: Test E2E
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Test E2E
id: test-e2e
run: |
docker-compose -f docker-compose.test.yml up -V --force-recreate --build --abort-on-container-exit --exit-code-from gerocuidado-saude-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 }}
15 changes: 10 additions & 5 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
sonar.projectKey=fga-eps-mds_2023-2-GEROcuidado-APISaude
sonar.organization=fga-eps-mds-1

sonar.projectName=2023-2-GEROcuidado-APISaude

sonar.sources=./src
sonar.sources.exclusions=./e2e, /.vscode
sonar.host.url=https://sonarcloud.io
sonar.language=ts

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

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

sonar.javascript.lcov.reportPaths=./coverage/unit/lcov.info
sonar.dynamicAnalysis=reuseReports
sonar.core.codeCoveragePlugin=cobertura
sonar.python.coverage.reportPaths=coverage.xml
sonar.python.xunit.reportPath=junit.xml

0 comments on commit a483a32

Please sign in to comment.