Django CI #758
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: Django CI | |
on: | |
push: | |
branches: [ develop ] | |
pull_request: | |
branches: [ develop ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.8] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Copy env file | |
run: cp env.example .env | |
- name: Setup Docker | |
run: | | |
source "$ENV_FILE" | |
docker compose up -d | |
env: | |
ENV_FILE: .env | |
PROJECT_NAME: brasil.io | |
DOCKER_COMPOSE_FILE: compose.yml | |
- name: Migrate and Update Data | |
run: | | |
docker compose run web python manage.py migrate --no-input | |
- name: Collect static staticfiles | |
run: | | |
docker compose run web python manage.py collectstatic --no-input | |
- name: Run Tests | |
run: | | |
docker compose run web pytest | |
- name: Run black | |
run: | | |
docker compose run web black . --exclude "docker" -l 120 --check | |
- name: Run flake8 | |
run: | | |
docker compose run web flake8 --config setup.cfg |