Atualização da branch main #54
This file contains 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: Testes Backend | |
on: | |
push: | |
branches: [ "main", "dev" ] | |
pull_request: | |
branches: [ "main", "dev" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.8] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install System Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc libmariadb-dev pkg-config | |
sudo apt-get clean | |
- name: Install Dependencies | |
working-directory: server | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Create .env file | |
working-directory: server | |
run: | | |
echo "DB_NAME=${{ secrets.DB_NAME }}" >> .env | |
echo "DB_USER=${{ secrets.DB_USER }}" >> .env | |
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env | |
echo "DB_HOST=${{ secrets.DB_HOST }}" >> .env | |
echo "DB_PORT=${{ secrets.DB_PORT }}" >> .env | |
echo "FRONTEND_URL=${{ secrets.FRONTEND_URL }}" >> .env | |
- name: Makemigrations | |
working-directory: server | |
run: | | |
python manage.py makemigrations | |
- name: Run Migrations | |
working-directory: server | |
run: | | |
python manage.py migrate --fake | |
- name: Run Tests | |
working-directory: server | |
run: | | |
python manage.py test | |
- name: Run Coverage | |
working-directory: server | |
run: | | |
coverage run manage.py test | |
coverage report -m |