From 434a871b973e0440ea427dec9226f6420d8109ff Mon Sep 17 00:00:00 2001 From: crydotsnake Date: Sat, 17 Apr 2021 10:49:11 +0200 Subject: [PATCH 1/3] Add GitHub Actions --- .github/workflows/lint.yml | 38 +++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 39 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..6110948 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +name: Lint + +on: [push, pull_request] + +jobs: + flake8: + name: flake8 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install flake8 + run: pip install --upgrade flake8 + - name: Run flake8 + uses: liskin/gh-problem-matcher-wrap@v1 + with: + linters: flake8 + run: flake8 + + isort: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - run: python -m pip install isort + - name: isort + uses: liskin/gh-problem-matcher-wrap@v1 + with: + linters: isort + run: isort -c -rc -df djangocms_video \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..fa7cae5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,39 @@ +name: CodeCov + +on: [push, pull_request] + +jobs: + unit-tests: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: [ 3.7, 3.8, 3.9, ] # latest release minus two + requirements-file: [ + dj22_cms37.txt, + dj22_cms38.txt, + dj30_cms37.txt, + dj30_cms38.txt, + dj31_cms38.txt, + ] + os: [ + ubuntu-20.04, + ] + + steps: + - uses: actions/checkout@v1 + - name: Set up Python ${{ matrix.python-version }} + + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r tests/requirements/${{ matrix.requirements-file }} + python setup.py install + - name: Run coverage + run: coverage run setup.py test + + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v1 \ No newline at end of file From 1a9c4fd5d8b3ec7b574d64e26078488bb3ea925e Mon Sep 17 00:00:00 2001 From: crydotsnake Date: Sat, 17 Apr 2021 10:50:19 +0200 Subject: [PATCH 2/3] Pin treebeard too 4.5 --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 1068f27..14d6528 100644 --- a/setup.py +++ b/setup.py @@ -8,6 +8,7 @@ 'django-cms>=3.7', 'django-filer>=1.7', 'djangocms-attributes-field>=1', + 'django-treebeard>=4.3,<4.5', ] From b71e13f04fe707b2a1d897d4c4d570785bc92206 Mon Sep 17 00:00:00 2001 From: crydotsnake Date: Sat, 17 Apr 2021 10:50:56 +0200 Subject: [PATCH 3/3] Delete .travis.yml --- .travis.yml | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d5efac8..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: python - -dist: xenial - -matrix: - include: - - python: 3.5 - env: TOX_ENV='flake8' - - python: 3.5 - env: TOX_ENV='isort' - # Django 2.2 - - python: 3.5 - env: DJANGO='dj22' CMS='cms37' - - python: 3.6 - env: DJANGO='dj22' CMS='cms37' - - python: 3.7 - env: DJANGO='dj22' CMS='cms37' - - python: 3.8 - env: DJANGO='dj22' CMS='cms37' - # Django 3.0, always run the lowest supported version - - python: 3.6 - env: DJANGO='dj30' CMS='cms37' - # Django 3.1, always run the lowest supported version - - python: 3.6 - env: DJANGO='dj31' CMS='cms38' - allow_failures: - - python: 3.6 - env: DJANGO='dj31' CMS='cms38' - -install: - - pip install coverage isort tox - - "if [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then export PY_VER=py35; fi" - - "if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then export PY_VER=py36; fi" - - "if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then export PY_VER=py37; fi" - - "if [[ $TRAVIS_PYTHON_VERSION == '3.8' ]]; then export PY_VER=py37; fi" - - "if [[ ${DJANGO}z != 'z' ]]; then export TOX_ENV=$PY_VER-$DJANGO-$CMS; fi" - -script: - - tox -e $TOX_ENV - -after_success: - - bash <(curl -s https://codecov.io/bash)