Skip to content

Adding test project and CI #13

Adding test project and CI

Adding test project and CI #13

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.10, 3.11]
django-version: [4.0, 4.1, 4.2]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Install dependencies
run: |
poetry config virtualenvs.create false
poetry install
- name: Install Django
run: |
poetry add django@${{ matrix.django-version }}
- name: Run database migrations and tests
run: |
cd test_project
poetry run python manage.py migrate
poetry run python manage.py test
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Install dependencies
run: |
poetry config virtualenvs.create false
poetry install
- name: Run Flake8
run: |
poetry run flake8 django_dharma/
- name: Run isort
run: |
poetry run isort --check-only django_dharma/