Skip to content
Merged
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
14 changes: 11 additions & 3 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ jobs:
- name: 2. Instalando o PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.1'

- name: 3. Instalando o Composer e dependências
run: composer install

- name: 4. A Hora da Verdade - Rodando o PHPUnit
run: ./vendor/bin/phpunit tests/ExemploTest.php
- name: 4. A Hora da Verdade - Rodando o PHPUnit e gerando relatório
# O parâmetro --testdox-html diz pro PHPUnit cuspir o resultado em um arquivo visual
run: ./vendor/bin/phpunit tests/ExemploTest.php --testdox-html relatorio-phpunit.html

- name: 5. Guardando o relatório como Artefato
uses: actions/upload-artifact@v4
if: always() # Super importante: salva o arquivo mesmo se o teste der erro
with:
name: relatorio-de-testes # O nome da pastinha que vai aparecer no GitHub
path: relatorio-phpunit.html # O nome exato do arquivo que o PHPUnit cuspiu
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ Repositório criado para estruturação e aprendizado de testes de unidade em ba
Para executar a validação inicial, rode o comando abaixo na raiz do projeto:

`./vendor/bin/phpunit tests/ExemploTest.php`

*Testando a integração contínua do GitHub Actions.*
Loading