From b540ceadb3a44acc5dc0b1827653480288550e3d Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 26 Nov 2020 16:18:58 +0100 Subject: [PATCH 1/5] Add GitHub Actions test workflow. --- .github/workflows/test.yml | 48 ++++++++++++++++++++++++++++++++++++++ tox.ini | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..801122e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,48 @@ +name: Test + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + max-parallel: 5 + matrix: + python-version: ['2.7', '3.5', '3.6', '3.7', '3.8', 'pypy3'] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: Cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: + ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }} + restore-keys: | + ${{ matrix.python-version }}-v1- + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade tox tox-gh-actions + + - name: Tox tests + run: | + tox -v + + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + name: Python ${{ matrix.python-version }} diff --git a/tox.ini b/tox.ini index e1df12f..bd2f94d 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ envlist = py{35,36,37,38,py3}-dj22 py{36,37,38,py3}-dj{30,master} -[travis] +[gh-actions] python = 2.7: py27 3.5: py35 From 64eefaef1ac493884e36a6b7fb527444275a1617 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 26 Nov 2020 16:51:15 +0100 Subject: [PATCH 2/5] Fix an issue with an old version of dj-email-url. --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index bd2f94d..15eb0cc 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,7 @@ setenv = COVERAGE_PROCESS_START = {toxinidir}/setup.cfg deps = dj111: django>=1.11,<2.0 + dj111: dj-email-url<1.0.0 dj20: django>=2.0a1,<2.1 dj21: django>=2.1a1,<2.2 dj22: django>=2.2a1,<3.0 From eea5b9ad34011e4e4a72ba6b6865f0f9bdc76295 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 26 Nov 2020 17:08:14 +0100 Subject: [PATCH 3/5] Remove travis cruft. --- .travis.yml | 37 ------------------------------------- MANIFEST.in | 1 - README.rst | 6 +++--- 3 files changed, 3 insertions(+), 41 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 150373b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: python -dist: xenial -cache: pip -python: -- '2.7' -- '3.5' -- '3.6' -- '3.7' -- '3.8' -- 'pypy3' -install: travis_retry pip install tox-travis codecov -script: tox -v -after_success: codecov --required -X gcov fix pycov -f coverage.xml --flags ${TOXENV//-/ } -branches: - except: templates/1.5.x templates/1.6.x -stages: -- test -- name: deploy - if: repo = jazzband/django-configurations AND tag IS present -jobs: - include: - - stage: test - - stage: deploy - install: skip - script: skip - python: 3.7 - env: skip - deploy: - provider: pypi - user: jazzband - server: https://jazzband.co/projects/django-configurations/upload - distributions: sdist bdist_wheel - password: - secure: LuserSjUTGSsls9zrvck/FbfL+gFpNU/ywOQ/67ufEbbpGCeDBEgxDzgb0acfHNk8wlAkaPvaAejQBFtcUulhdNT/g0NsmaEAjd6HhCGM+FRJAnYFaj33Js6C+N2tX5wznL7uCBxqgtaaH0hf6ucqC8OXqwoCVGgdxAEnUlC/fY= - on: - tags: true - repo: jazzband/django-configurations diff --git a/MANIFEST.in b/MANIFEST.in index 89a0335..4f06150 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,6 @@ include README.rst include CONTRIBUTING.md include AUTHORS -include .travis.yml include tox.ini recursive-include tests * recursive-include docs * diff --git a/README.rst b/README.rst index 545ae17..536b154 100644 --- a/README.rst +++ b/README.rst @@ -13,9 +13,9 @@ Check out the `documentation`_ for more complete examples. .. |latest-version| image:: https://img.shields.io/pypi/v/django-configurations.svg :alt: Latest version on PyPI :target: https://pypi.python.org/pypi/django-configurations -.. |build-status| image:: https://img.shields.io/travis/jazzband/django-configurations/master.svg - :alt: Build status - :target: https://travis-ci.org/jazzband/django-configurations +.. |build-status| image:: https://github.com/jazzband/django-configurations/workflows/Test/badge.svg + :target: https://github.com/jazzband/django-configurations/actions + :alt: GitHub Actions .. |codecov| image:: https://codecov.io/github/jazzband/django-configurations/coverage.svg?branch=master :alt: Codecov :target: https://codecov.io/github/jazzband/django-configurations?branch=master From 5053da43579bc1cc7af4ad3a910a675fd591d273 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 26 Nov 2020 17:08:22 +0100 Subject: [PATCH 4/5] Add release workflow. --- .github/workflows/release.yml | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..707641d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + build: + if: github.repository == 'jazzband/django-configurations' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: Cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: release-${{ hashFiles('**/setup.py') }} + restore-keys: | + release- + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -U setuptools twine wheel + + - name: Build package + run: | + python setup.py --version + python setup.py sdist --format=gztar bdist_wheel + twine check dist/* + + - name: Upload packages to Jazzband + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: jazzband + password: ${{ secrets.JAZZBAND_RELEASE_KEY }} + repository_url: https://jazzband.co/projects/django-configurations/upload From f5bebd4eccce5d48c3908480cd72a4ae3bbbdf6f Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Fri, 27 Nov 2020 09:59:12 +0100 Subject: [PATCH 5/5] Add fail_ci_if_error to test workflow. --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 801122e..792baf8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,3 +46,4 @@ jobs: uses: codecov/codecov-action@v1 with: name: Python ${{ matrix.python-version }} + fail_ci_if_error: true