Add nginx configuration #12
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: Tests CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
max-parallel: 4 | |
matrix: | |
python-version: [3.12.x] | |
services: | |
postgres: | |
image: postgres:14-alpine | |
env: | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip -r requirements/test.txt | |
- name: Set up databases | |
run: | | |
PGPASSWORD="postgres" createuser -U postgres -d django_template --superuser -h localhost | |
PGPASSWORD="postgres" createdb -U postgres -O django_template django_template -h localhost | |
- name: Create .env file | |
run: | | |
echo "${{ secrets.ENV_FILE }}" > .env | |
- name: Migrate database | |
run: | | |
python manage.py migrate | |
- name: Collect static | |
run: | | |
python manage.py collectstatic --no-input --clear | |
- name: Load fixture | |
run: | | |
python manage.py loaddata authentication/fixtures/customer.json --app authentication.customer | |
- name: Check linter | |
run: | | |
flake8 . | |
- name: Format code | |
run: | | |
black . | |
isort . | |
- name: Run unit test and report coverage | |
run: | | |
coverage run --source='.' manage.py test | |
coverage report |