As part of a continuous integration strategy between our team, we implement a three-stage GitHub Action that validates: code format, using black formatter, errors and code style (e.g. unassigned variables), using flake8, and unit tests, using pytest. The following badge is a simbol that easily identifies if our code passed through all three validations or not.
Important links
For more relevant information, access our document file, available here.
Before cloning, make sure you add your public SSH key in github.
$ git clone git@github.com:thigcampos/gestao-academica.git
And cd into the root folder:
cd gestao-academica
pip install pipenv
New to pipenv? No problem! Read more here.
cp env.example .env
Pipenv will look for this file (.env) in order to export environment variables into your shell.
pipenv shell
pipenv install --ignore-pipfile
Now, let's setup the database.
python manage.py makemigrations
Then, run:
python manage.py migrate
Give execute
permissions to our setup script:
chmod +x setup.sh
Then, run it:
./setup.sh
pipenv run ./manage.py runserver 8000
It should be up and running in http://localhost:8000. You can also access http://localhost:8000/admin.
pipenv run pytest
pipenv run coverage run -m pytest
Open coverage details:
pipenv run coverage html
./manage.py generate_puml