Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/workflows/02-tests-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ 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: actions/setup-node@v5
with:
node-version: ${{ env.NODE_VERSION }}

- name: "Instalar Deps"
run: npm ci

- name: "Executar tests"
run: npm run tests

- 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
Expand All @@ -32,6 +38,12 @@ jobs:
echo "Coverage: $COVERAGE%"
echo "coverage=$COVERAGE" >> $GITHUB_OUTPUT

- name: "Validar se os testes passaram"
if: ${{ steps.coverage.outputs.coverage < env.COVERAGE_MIN }}
run: |
echo "Cobertura mínima de testes não atendida: Esperado - ${{ env.COVERAGE_MIN }}%. Atingido - ${{ steps.coverage.outputs.coverage }}"
exit 1

generate-certificate: # DAQUI PARA BAIXO, NÃO ALTERAR
name: "Desafio Nível 2 - Certificado"
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Descomplicando GitHub Actions

Desafio realizado pelo Leonardo Vieira Neto

Se inscreva na aula ao vivo e gratuita: https://quiz.linuxtips.io/github-actions

Bem-vindo ao **Descomplicando GitHub Actions**! Este projeto foi criado pela comunidade **LINUXtips** para você aprender os conceitos básicos de CI/CD na prática de forma simples e direta.
Expand Down