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

Conversation

browniebroke
Copy link
Member

@browniebroke browniebroke commented Nov 6, 2020

Subject: Move CI to Github as Travis builds have become too slow

Feature or Bugfix

  • Feature

Purpose

Move the CI to Github Actions. The config is a bit more verbose than I'd like to, but this should have the advantage to be explicit.

Detail

Relates

I have another PR that will conflict: #68

Given that Travis is too painful to work with, I'll update that other PR when this is merged.

⚠️ IMPORTANT ⚠️

A project admin will have to add JAZZBAND_RELEASE_KEY to the repo secrets: https://github.com/jazzband/django-redshift-backend/settings/secrets/actions/new

Comment on lines +95 to +97
raise NotSupportedError(
'DISTINCT ON fields is not supported by this database backend'
)
Copy link
Member Author

Choose a reason for hiding this comment

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

- 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.

@browniebroke
Copy link
Member Author

Not sure why the builds aren't running, but they do run on my fork: https://github.com/browniebroke/django-redshift-backend/actions?query=workflow%3ACI

Copy link
Member

@shimizukawa shimizukawa left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks!!


- name: Publish packages
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.4.1
Copy link
Member

Choose a reason for hiding this comment

The 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 pypa/gh-action-pypi-publish with the API provided by PyPI would be better in the future.

Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The 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 prettytable, should be a good starting point.

- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6
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: Tox tests
shell: bash
run: tox -e ${{ matrix.versions.tox }}
Copy link
Member

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

@jezdez
Copy link
Member

jezdez commented Nov 8, 2020

Please use tox-gh-actions for configuring the test matrix instead of duplicating it in the GH actions and tox configuration. This is along the lines we've done with tox-travis.

@browniebroke browniebroke force-pushed the gh-actions branch 3 times, most recently from a68c17e to 9e634fd Compare November 8, 2020 13:26
@browniebroke
Copy link
Member Author

Updated test to use tox-gh-actions and deployment steps to use Jazzband package index.

Build result: https://github.com/browniebroke/django-redshift-backend/actions/runs/352344702

Copy link
Member

@jezdez jezdez left a comment

Choose a reason for hiding this comment

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

Thanks, this is looking more and more like what we need, thank you for working on this!

A few things that would be better:

  • separate test, lint and deploy workflows like in prettytable
  • the deploy workflow should use the "published" event type instead of checking manually for the existence of a git tag

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@browniebroke
Copy link
Member Author

I think it's all done. Let me know if I missed anything.

@browniebroke browniebroke changed the title MIgrate to Github Actions Migrate to Github Actions Nov 9, 2020
@browniebroke
Copy link
Member Author

Is there anything else I need to change here?

@shimizukawa
Copy link
Member

@browniebroke Thank you for your work!

@jezdez I'm going to release a new version after merging this PR. What do we need next?

@shimizukawa
Copy link
Member

@jezdez ping and Happy New Year!!

@jezdez jezdez mentioned this pull request Jan 3, 2021
1 task
@jezdez
Copy link
Member

jezdez commented Jan 3, 2021

I've fixed a few more things in #72. Closing this PR since I wasn't able to push to the branch of this PR being in a fork repo.

@jezdez jezdez closed this Jan 3, 2021
@shimizukawa
Copy link
Member

Now I've released 2.0.0. Thanks for your contribution!
https://pypi.org/project/django-redshift-backend/2.0.0/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Very long TravisCI builds
3 participants