diff --git a/.circleci/Dockerfile b/.circleci/Dockerfile deleted file mode 100644 index 421f6bb..0000000 --- a/.circleci/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -ARG PYTHON_VERSION=3.6 -FROM circleci/python:$PYTHON_VERSION - -WORKDIR /home/circleci/app/ -COPY . /home/circleci/app/ -RUN sudo chown -R circleci:circleci . -RUN sudo pip install tox diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index c71b830..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,135 +0,0 @@ -version: 2.0 - -py38default: &py38default - docker: - - image: circleci/python:3.8 - steps: - - setup_remote_docker: - docker_layer_caching: false - - checkout - - attach_workspace: - at: /tmp/images - - run: docker load -i /tmp/images/py38.tar || true - - run: docker run py38 tox -e $CIRCLE_JOB - -py39default: &py39default - docker: - - image: circleci/python:3.9 - steps: - - setup_remote_docker: - docker_layer_caching: false - - checkout - - attach_workspace: - at: /tmp/images - - run: docker load -i /tmp/images/py39.tar || true - - run: docker run py39 tox -e $CIRCLE_JOB - -py310default: &py310default - docker: - - image: circleci/python:3.10 - steps: - - setup_remote_docker: - docker_layer_caching: false - - checkout - - attach_workspace: - at: /tmp/images - - run: docker load -i /tmp/images/py310.tar || true - - run: docker run py310 tox -e $CIRCLE_JOB - -py38_requires: &py38_requires - requires: - - py38_base - -py39_requires: &py39_requires - requires: - - py39_base - -py310_requires: &py310_requires - requires: - - py310_base - -jobs: - py38_base: - docker: - - image: circleci/python:3.8 - steps: - - checkout - - setup_remote_docker: - docker_layer_caching: false - - run: docker build -f .circleci/Dockerfile --build-arg PYTHON_VERSION=3.8 -t py38 . - - run: mkdir images - - run: docker save -o images/py38.tar py38 - - persist_to_workspace: - root: images - paths: py38.tar - py39_base: - docker: - - image: circleci/python:3.9 - steps: - - checkout - - setup_remote_docker: - docker_layer_caching: false - - run: docker build -f .circleci/Dockerfile --build-arg PYTHON_VERSION=3.9 -t py39 . - - run: mkdir images - - run: docker save -o images/py39.tar py39 - - persist_to_workspace: - root: images - paths: py39.tar - py310_base: - docker: - - image: circleci/python:3.10 - steps: - - checkout - - setup_remote_docker: - docker_layer_caching: false - - run: docker build -f .circleci/Dockerfile --build-arg PYTHON_VERSION=3.10 -t py310 . - - run: mkdir images - - run: docker save -o images/py310.tar py310 - - persist_to_workspace: - root: images - paths: py310.tar - - flake8: - <<: *py310default - isort: - <<: *py310default - - py38-dj32-sqlite-cms40: - <<: *py38default - py39-dj32-sqlite-cms40: - <<: *py39default - - py39-dj42-sqlite-cms40: - <<: *py39default - py310-dj42-sqlite-cms40: - <<: *py310default - -####################### - -workflows: - version: 2 - build: - jobs: - - py38_base - - py39_base - - py310_base - - flake8: - requires: - - py310_base - - isort: - requires: - - py310_base - - - py38-dj32-sqlite-cms40: - requires: - - py38_base - - py39-dj32-sqlite-cms40: - requires: - - py39_base - - - py39-dj42-sqlite-cms40: - requires: - - py39_base - - py310-dj42-sqlite-cms40: - requires: - - py310_base \ No newline at end of file diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000..4adbab1 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,39 @@ +name: django CMS Content Expiry linters.yml + +on: [pull_request, push] + +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 + - run: pip install --upgrade flake8 + - name: flake8 + uses: liskin/gh-problem-matcher-wrap@v1 + with: + linters: flake8 + run: | + flake8 + isort: + name: 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 ./ + diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..f193e23 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,36 @@ +name: django CMS Content Expiry test.yml + +on: [pull_request, push] + +jobs: + database-sqlite: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [ 3.9, '3.10'] # latest release minus two + requirements-file: [ + django-32-cms40.txt, + django-42-cms40.txt, + django-42-cms41.txt, + ] + + 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: | + sudo apt install gettext gcc -y + python -m pip install --upgrade pip + pip install pytest + pip install -r tests/requirements/${{ matrix.requirements-file }} + python setup.py install + - name: Test with python test runner + run: | + python setup.py test + env: + DATABASE_URL: sqlite://localhost/testdb.sqlite