From 1b8e7f35b0bbb4dd93f89d3bb51a390db1ed4ded Mon Sep 17 00:00:00 2001 From: Leonardo Castilho Date: Mon, 16 Feb 2026 02:25:27 -0300 Subject: [PATCH 1/5] README alteration --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bb74fc..ad276c7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Descomplicando GitHub Actions +Aluno: Leonardo Castilho Se inscreva na aula ao vivo e gratuita: https://quiz.linuxtips.io/github-actions From 7fb8741c5f10326f46f4031c18ddd0b243f7a4b0 Mon Sep 17 00:00:00 2001 From: Leonardo Castilho Date: Mon, 16 Feb 2026 03:25:05 -0300 Subject: [PATCH 2/5] verification 80% --- .github/workflows/02-tests-ci.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/02-tests-ci.yml b/.github/workflows/02-tests-ci.yml index 3a9801b..1c3f550 100644 --- a/.github/workflows/02-tests-ci.yml +++ b/.github/workflows/02-tests-ci.yml @@ -28,8 +28,26 @@ jobs: - 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 run: | - COVERAGE=$(npx nyc report --reporter=text-summary | grep -oP 'Statements\s*:\s*\K[0-9\.]+(?=%)' | head -1) + echo "Rodando testes..." + npm run tests + + echo "Gerando relatório de coverage..." + COVERAGE=$(npx nyc report --reporter=text-summary | awk '/Statements/ {print $3}' | tr -d '%') + + if [ -z "$COVERAGE" ]; then + echo "Erro ao capturar coverage" + exit 1 + fi + echo "Coverage: $COVERAGE%" + + if (( $(echo "$COVERAGE < 80" | bc -l) )); then + echo "Coverage menor que 80%" + exit 1 + else + echo "Coverage maior ou igual a 80%" + fi + echo "coverage=$COVERAGE" >> $GITHUB_OUTPUT generate-certificate: # DAQUI PARA BAIXO, NÃO ALTERAR From ac2ab9ad59698fc60f005137eb34c8983cdf67ed Mon Sep 17 00:00:00 2001 From: Leonardo Castilho Date: Mon, 16 Feb 2026 03:43:38 -0300 Subject: [PATCH 3/5] desafio 2 --- teste.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 teste.txt diff --git a/teste.txt b/teste.txt new file mode 100644 index 0000000..e69de29 From 38918fd7bae21b7f6b3997fdf8eccfa3d83c4b65 Mon Sep 17 00:00:00 2001 From: Leonardo Castilho Date: Mon, 16 Feb 2026 03:49:30 -0300 Subject: [PATCH 4/5] npm install --- .github/workflows/02-tests-ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/02-tests-ci.yml b/.github/workflows/02-tests-ci.yml index 1c3f550..6acd6fa 100644 --- a/.github/workflows/02-tests-ci.yml +++ b/.github/workflows/02-tests-ci.yml @@ -20,10 +20,13 @@ 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" + uses: action/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: "Instalar dependências" + run: npm install - 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 216bc7fee8a4f404e1ba99df423faf026108f580 Mon Sep 17 00:00:00 2001 From: Leonardo Castilho Date: Mon, 16 Feb 2026 03:55:31 -0300 Subject: [PATCH 5/5] a --- .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 6acd6fa..460da2a 100644 --- a/.github/workflows/02-tests-ci.yml +++ b/.github/workflows/02-tests-ci.yml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v4 - name: "Setup Node" - uses: action/setup-node@v4 + uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }}