-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Changes from 6 commits
06c969b
b6e543e
c899afc
b786ee7
881bfaf
b4859a2
4522fdd
8309124
a2876bf
1ef2bfe
6e90872
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
FORCE_COLOR: 1 | ||
|
||
jobs: | ||
tests: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# https://docs.djangoproject.com/en/stable/faq/install/#what-python-version-can-i-use-with-django | ||
versions: | ||
# Linting | ||
- tox: flake8 | ||
python: 3.6 | ||
- tox: readme | ||
python: 3.6 | ||
|
||
# Django 1.11 | ||
- tox: py27-dj111 | ||
python: 2.7 | ||
- tox: py35-dj111 | ||
python: 3.5 | ||
- tox: py36-dj111 | ||
python: 3.6 | ||
|
||
# Django 2.0 | ||
- tox: py35-dj20 | ||
python: 3.5 | ||
- tox: py36-dj20 | ||
python: 3.6 | ||
- tox: py37-dj20 | ||
python: 3.7 | ||
|
||
# Django 2.1 | ||
- tox: py35-dj21 | ||
python: 3.5 | ||
- tox: py36-dj21 | ||
python: 3.6 | ||
- tox: py37-dj21 | ||
python: 3.7 | ||
|
||
# TODO: test on mac OS & windows? | ||
os: | ||
- ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.versions.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.versions.python }}-v1-${{ hashFiles('**/setup.py') }} | ||
restore-keys: | | ||
${{ matrix.os }}-${{ matrix.versions.python }}-v1- | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install -U tox | ||
|
||
- name: Tox tests | ||
shell: bash | ||
run: tox -e ${{ matrix.versions.tox }} | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- tests | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.6 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that the deploy step used to run on Python 2.7. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since |
||
|
||
- name: Install dependencies | ||
run: python -m pip install -U pip wheel | ||
|
||
- name: Build packages | ||
run: python setup.py sdist bdist_wheel | ||
|
||
- name: Publish packages | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@v1.4.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know about the Jazzband way of releasing, but I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jezdez please check this deploy section. After you agree on the deploy section, we can merge this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't using the Jazzband package index, so will need to update to use it. I'll get to do a proper review later tonight. Don't merge this before. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I looked at Jazzband's release process and I think I get it... Packages are not published to PyPI directly, they are first going to Jazzband package index which in turns publich to PyPI? I'll copy the publish part from |
||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was failing flake8. |
||
return super(DatabaseOperations, self).distinct_sql(fields, *args) | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen the results of your execution. I think it's perfect 🎉
https://github.com/browniebroke/django-redshift-backend/runs/1364264120