From 7d2b6e9ddaa0b73959313dec709ef7467f0feebc Mon Sep 17 00:00:00 2001 From: gabezy Date: Wed, 17 Sep 2025 22:16:17 -0300 Subject: [PATCH 1/7] feat: roda testes --- .github/workflows/02-tests-ci.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/02-tests-ci.yml b/.github/workflows/02-tests-ci.yml index 3a9801b..d710a7b 100644 --- a/.github/workflows/02-tests-ci.yml +++ b/.github/workflows/02-tests-ci.yml @@ -20,10 +20,24 @@ jobs: - name: "Checkout do código" uses: actions/checkout@v4 - # INSIRA AQUI A LÓGICA PARA RODAR OS TESTES E VERIFICAR A COBERTURA - ### - ### - ### + - name: "Setup Node.js" + id: setup + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: "Instalar dependências" + run: | + echo "Instalando dependências..." + npm ci + echo "Dependências instaladas com sucesso!" + + - name: "Rodar testes" + run: | + echo "Rodando testes..." + npm test + echo "Testes executados com sucesso!" - name: "Extrair porcentagem de cobertura" # Esse step será validado pelo desafio, não altere o nome. No final, ele deve gerar o output "coverage" com a porcentagem de cobertura. id: coverage From 68b47c52cd41036a7bd8514dfbf19acff91a2b2f Mon Sep 17 00:00:00 2001 From: gabezy Date: Wed, 17 Sep 2025 22:17:11 -0300 Subject: [PATCH 2/7] add --- .github/workflows/02-tests-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/02-tests-ci.yml b/.github/workflows/02-tests-ci.yml index d710a7b..40b8750 100644 --- a/.github/workflows/02-tests-ci.yml +++ b/.github/workflows/02-tests-ci.yml @@ -37,7 +37,7 @@ jobs: run: | echo "Rodando testes..." npm test - echo "Testes executados com sucesso!" + echo "Testes executados com sucesso!!" - name: "Extrair porcentagem de cobertura" # Esse step será validado pelo desafio, não altere o nome. No final, ele deve gerar o output "coverage" com a porcentagem de cobertura. id: coverage From 4063acf121c7dfb5c0d1fa790a56f64e84e5c8da Mon Sep 17 00:00:00 2001 From: gabezy Date: Wed, 17 Sep 2025 22:19:03 -0300 Subject: [PATCH 3/7] add --- .github/workflows/02-tests-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/02-tests-ci.yml b/.github/workflows/02-tests-ci.yml index 40b8750..079212f 100644 --- a/.github/workflows/02-tests-ci.yml +++ b/.github/workflows/02-tests-ci.yml @@ -31,7 +31,7 @@ jobs: run: | echo "Instalando dependências..." npm ci - echo "Dependências instaladas com sucesso!" + echo "Dependências instaladas com sucesso!!" - name: "Rodar testes" run: | From c9fc8e25b3eb891ba3ceaf721fcb3b6bbd5b0228 Mon Sep 17 00:00:00 2001 From: gabezy Date: Wed, 17 Sep 2025 22:22:59 -0300 Subject: [PATCH 4/7] add --- .github/workflows/02-tests-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/02-tests-ci.yml b/.github/workflows/02-tests-ci.yml index 079212f..6e0c99a 100644 --- a/.github/workflows/02-tests-ci.yml +++ b/.github/workflows/02-tests-ci.yml @@ -36,7 +36,7 @@ jobs: - name: "Rodar testes" run: | echo "Rodando testes..." - npm test + npm run tests echo "Testes executados com sucesso!!" - name: "Extrair porcentagem de cobertura" # Esse step será validado pelo desafio, não altere o nome. No final, ele deve gerar o output "coverage" com a porcentagem de cobertura. From a9a7eb66d2745289b55333b62a78ed6564bfe965 Mon Sep 17 00:00:00 2001 From: gabezy Date: Wed, 17 Sep 2025 22:32:16 -0300 Subject: [PATCH 5/7] add --- .github/workflows/02-tests-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/02-tests-ci.yml b/.github/workflows/02-tests-ci.yml index 6e0c99a..97d1b73 100644 --- a/.github/workflows/02-tests-ci.yml +++ b/.github/workflows/02-tests-ci.yml @@ -45,6 +45,12 @@ jobs: COVERAGE=$(npx nyc report --reporter=text-summary | grep -oP 'Statements\s*:\s*\K[0-9\.]+(?=%)' | head -1) echo "Coverage: $COVERAGE%" echo "coverage=$COVERAGE" >> $GITHUB_OUTPUT + + - name: "Verificar se cobertura mínima foi atingida" + id: check-coverage + run: | + echo "${{ needs.tests-and-coverage.outputs.coverage }}" + generate-certificate: # DAQUI PARA BAIXO, NÃO ALTERAR name: "Desafio Nível 2 - Certificado" From 00d720b517c4f4da18c1321e0dc4db8a9f04dcd1 Mon Sep 17 00:00:00 2001 From: gabezy Date: Wed, 17 Sep 2025 22:35:53 -0300 Subject: [PATCH 6/7] add --- .github/workflows/02-tests-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/02-tests-ci.yml b/.github/workflows/02-tests-ci.yml index 97d1b73..253c394 100644 --- a/.github/workflows/02-tests-ci.yml +++ b/.github/workflows/02-tests-ci.yml @@ -49,7 +49,7 @@ jobs: - name: "Verificar se cobertura mínima foi atingida" id: check-coverage run: | - echo "${{ needs.tests-and-coverage.outputs.coverage }}" + echo "$COVERAGE" generate-certificate: # DAQUI PARA BAIXO, NÃO ALTERAR From 13cf82671c654633c5ffa68f4d234331da54ebe1 Mon Sep 17 00:00:00 2001 From: gabezy Date: Wed, 17 Sep 2025 22:36:45 -0300 Subject: [PATCH 7/7] add --- .github/workflows/02-tests-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/02-tests-ci.yml b/.github/workflows/02-tests-ci.yml index 253c394..836e82e 100644 --- a/.github/workflows/02-tests-ci.yml +++ b/.github/workflows/02-tests-ci.yml @@ -49,7 +49,7 @@ jobs: - name: "Verificar se cobertura mínima foi atingida" id: check-coverage run: | - echo "$COVERAGE" + echo "$COVERAGE%" generate-certificate: # DAQUI PARA BAIXO, NÃO ALTERAR