Skip to content

Commit

Permalink
fix: ajusta arquivo de cobertura
Browse files Browse the repository at this point in the history
  • Loading branch information
clara-marcelino-desco committed Dec 6, 2024
1 parent b4cba7f commit 17543f9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 50 deletions.
76 changes: 27 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ jobs:
- name: 🧪 Roda suíte de testes
run: npm test

sonarqube:
name: SonarQube
sonarcloud:
name: sonarcloud
needs: [test]
runs-on: ubuntu-latest
env:
Expand All @@ -111,55 +111,33 @@ jobs:
PORT: ${{ secrets.PORT }}
EMAIL: ${{ secrets.EMAIL }}
SECRET: ${{ secrets.SECRET }}
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4

- name: 📬 Caching
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/dist
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.{js,jsx,ts,tsx}') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-
- name: 🧰 Instala bibliotecas e dependências
run: npm i

- name: 📜 Relatório do eslint
run: npx eslint -f json -o reports/eslint-report.json src || true

- name: 🧪 Testes e cobertura
run: JEST_SONAR=jest-sonar CI=true npm test -- --coverage --passWithNoTests

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

# sonarcloud:
# name: sonarcloud
# needs: [test]
# runs-on: ubuntu-latest
# env:
# MONGO_URI: ${{ secrets.MONGO_URI }}
# MONGO_INITDB_ROOT_USERNAME: ${{ secrets.MONGO_INITDB_ROOT_USERNAME }}
# MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.MONGO_INITDB_ROOT_PASSWORD }}
# DB_HOST: ${{ secrets.DB_HOST }}
# PORT: ${{ secrets.PORT }}
# EMAIL: ${{ secrets.EMAIL }}
# SECRET: ${{ secrets.SECRET }}
# continue-on-error: true
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# fetch-depth: 0

# - name: 📬 Caching
# uses: actions/cache@v3
# with:
# path: |
# ${{ github.workspace }}/node_modules
# ${{ github.workspace }}/dist
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.{js,jsx,ts,tsx}') }}
# restore-keys: |
# ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-
# - name: 🧰 Instala bibliotecas e dependências
# run: npm i

# - name: 📜 Relatório do eslint
# run: npx eslint -f json -o reports/eslint-report.json src || true

# - name: 🧪 Testes e cobertura
# run: JEST_SONAR=jest-sonar CI=true npm test -- --coverage --passWithNoTests

# - name: SonarCloud Scan
# uses: SonarSource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const config = {
: ["default"],

// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: ["lcov"],
coverageReporters: ["lcov", "text", "clover"],

// An object that configures minimum threshold enforcement for coverage results
// coverageThreshold: undefined,
Expand Down

0 comments on commit 17543f9

Please sign in to comment.