Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Github Actions #71

Closed
wants to merge 11 commits into from
84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,84 @@
name: CI

on: [push, pull_request]

env:
FORCE_COLOR: 1

jobs:
tests:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
python: ["2.7", "3.5", "3.6", "3.7"]
django: ["1.11", "2.0", "2.1"]
# TODO: test on mac OS & windows?
os: [ubuntu-latest]
exclude:
- django: "2.0"
python: "2.7"
- django: "2.1"
python: "2.7"

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"

- uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.os }}-${{ matrix.python }}-${{ matrix.django }}-v1-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python }}-${{ matrix.django }}-v1-

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U tox tox-gh-actions

- name: Tox tests
shell: bash
run: tox
env:
DJANGO: ${{ matrix.django }}

deploy:
runs-on: ubuntu-latest
needs:
- tests

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the deploy step used to run on Python 2.7.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since django-redshift-backend doesn't create a binary wheel, so I don't think that's a problem.


- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools twine wheel

- name: Build packages
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
twine check dist/*

- name: Publish 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/prettytable/upload
browniebroke marked this conversation as resolved.
Show resolved Hide resolved
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.rst
Expand Up @@ -26,9 +26,9 @@ This is a `Amazon Redshift`_ database backend for Django_.
:alt: License
:target: https://github.com/jazzband/django-redshift-backend/blob/master/LICENSE

.. image:: https://img.shields.io/travis/jazzband/django-redshift-backend/master.svg
:alt: Travis (.org) branch
:target: https://travis-ci.org/jazzband/django-redshift-backend
.. image:: https://img.shields.io/github/workflow/status/jazzband/django-redshift-backend/CI/master
:alt: CI Status
:target: https://github.com/jazzband/django-redshift-backend/actions?query=workflow%3ACI

.. image:: https://img.shields.io/github/stars/jazzband/django-redshift-backend.svg?style=social&label=Stars
:alt: GitHub stars
Expand Down
4 changes: 2 additions & 2 deletions checklist.rst
Expand Up @@ -2,10 +2,10 @@

Procedure:

1. check travis-ci testing result: https://travis-ci.org/jazzband/django-redshift-backend
1. check CI status testing result: https://github.com/jazzband/django-redshift-backend/actions?query=workflow%3ACI
2. update release version/date in ``CHANGES.rst``
3. tagging with version name that MUST following semver. e.g.: ``git tag 1.0.1``
4. ``git push --tags`` to invoke release process on travis-ci.
4. ``git push --tags`` to invoke release process in Github Actions.
5. approve release files. please check your email or https://jazzband.co/projects/django-redshift-backend
6. check PyPI page: https://pypi.org/p/django-redshift-backend
7. bump version in ``CHANGES.rst`` and commit/push them onto GitHub
Expand Down
5 changes: 3 additions & 2 deletions django_redshift_backend/base.py
Expand Up @@ -92,8 +92,9 @@ def distinct_sql(self, fields, *args):
if fields:
# https://github.com/jazzband/django-redshift-backend/issues/14
# Redshift doesn't support DISTINCT ON
raise NotSupportedError('DISTINCT ON fields is not supported '
'by this database backend')
raise NotSupportedError(
'DISTINCT ON fields is not supported by this database backend'
)
Comment on lines +95 to +97
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return super(DatabaseOperations, self).distinct_sql(fields, *args)


Expand Down
4 changes: 2 additions & 2 deletions doc/dev.rst
Expand Up @@ -38,9 +38,9 @@ tox have several sections for testing.
CI (Continuous Integration)
----------------------------

All tests will be run on Travis CI service.
All tests will be run on Github Actions:

* https://travis-ci.org/jazzband/django-redshift-backend
* https://github.com/jazzband/django-redshift-backend/actions?query=workflow%3ACI


Pull Request
Expand Down
6 changes: 3 additions & 3 deletions doc/index.rst
Expand Up @@ -26,9 +26,9 @@ This is a `Amazon Redshift`_ database backend for Django_.
:alt: License
:target: https://github.com/jazzband/django-redshift-backend/blob/master/LICENSE

.. image:: https://img.shields.io/travis/jazzband/django-redshift-backend/master.svg
:alt: Travis (.org) branch
:target: https://travis-ci.org/jazzband/django-redshift-backend
.. image:: https://img.shields.io/github/workflow/status/jazzband/django-redshift-backend/CI/master
:alt: CI Status
:target: https://github.com/jazzband/django-redshift-backend/actions?query=workflow%3ACI

.. image:: https://img.shields.io/github/stars/jazzband/django-redshift-backend.svg?style=social&label=Stars
:alt: GitHub stars
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Expand Up @@ -8,14 +8,14 @@ envlist =
readme
skipsdist = True

[travis]
[gh-actions]
python =
2.7: py27
3.5: py35
3.6: py36,flake8,readme
3.7: py37

[travis:env]
[gh-actions:env]
DJANGO =
1.11: dj111
2.0: dj20
Expand Down