Implementação CI/CD com testes automatizados no backend #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD Pipeline | |
| on: [push, pull_request] | |
| jobs: | |
| backend-tests: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./backend | |
| env: | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }} | |
| JWT_EXPIRATION_TIME: ${{ secrets.JWT_EXPIRATION_TIME }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Instalação Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Instalação Poetry | |
| run: pipx install poetry | |
| - name: Instalação das dependências | |
| run: poetry install | |
| - name: Testes | |
| run: poetry run pytest -s -v |