diff --git a/.editorconfig b/.editorconfig index baf0bdc..58eabbd 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,3 +10,6 @@ end_of_line = lf [*.py] max_line_length = 119 + +[{*.yml,*.yaml}] +indent_size = 2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ed803e6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: Test + +on: + - push + - pull_request + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Lint + run: make lint + + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + # Keep in sync with tox.ini + - '3.8' + - '3.10' + - '3.12' + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh-actions + - name: Test with tox + run: tox diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ed82b6b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -# Config file for automatic testing at travis-ci.org -language: python -python: - - 3.6 - - 3.7 - - 3.8 -env: - - DJANGO_VERSION='Django~=2.2.0' - - DJANGO_VERSION='Django~=3.0.0' - - DJANGO_VERSION='Django~=3.1.0' - - DJANGO_VERSION='Django~=3.2.0' - - DJANGO_VERSION='https://github.com/django/django/archive/refs/heads/main.zip' -jobs: - exclude: - - python: 3.6 - env: DJANGO_VERSION='https://github.com/django/django/archive/refs/heads/main.zip' - - python: 3.7 - env: DJANGO_VERSION='https://github.com/django/django/archive/refs/heads/main.zip' -install: - - pip install --upgrade pip - - pip install --upgrade $DJANGO_VERSION - - pip install -q -e . - - pip install -q -r requirements.txt -script: - - coverage run --source djrichtextfield --branch manage.py test -after_success: - - coveralls -branches: - only: - - master diff --git a/tox.ini b/tox.ini index 952cb11..b935006 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ envlist = py{38,310,312}-dj{32,42},py{312}-dj{main} [testenv] +# Keep in sync with .github/workflows/ci.yml basepython = py38: python3.8 py310: python3.10 py312: python3.12