-
Notifications
You must be signed in to change notification settings - Fork 4
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
Reusable workflows for packaging and Poetry-CI #1
Conversation
d4deca6
to
b46b25b
Compare
b46b25b
to
627a037
Compare
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.
Looks good to me; just some optional tweaks, really (I think having the tool name there is helpful for recognition when you haven't had enough coffee to remember what 'semantic checks' are, for example) — though I now realise these are probably not the top-level job names anyway, so probably doesn't matter.
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: Sdist | ||
path: dist/*.tar.gz |
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.
are we going to use this pipeline for Synapse eventually? Do we want this automatic upload for Synapse (it would change the current procedure).
I'm actually fairly happy to have it done automatically, but I guess it's something that could be checked with the team.
Depending on the answer, we might want this to be gated behind a condition / input flag.
Edit: this also applies to the wheel
Edit 2: Wait — is this uploading to GitHub or to PyPI? I now think this is GitHub, right? Installing twine beforehand confused me; if it's not just me being stupid, would it be OK to add a comment saying that this uploads to GitHub... 😅
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.
This is just to github. Twine is there as a "check we could upload this wheel to PyPI if we wanted to".
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.
How does d38fe95 suit you?
Co-authored-by: reivilibre <olivier@librepush.net>
Not just for Christmas.
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.
parfaît!
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Poetry | ||
uses: matrix-org/setup-python-poetry@v1 | ||
|
||
- name: Import order (isort) | ||
run: poetry run isort --check --diff . | ||
|
||
- name: Code style (black) | ||
run: poetry run black --check . | ||
|
||
- name: Semantic checks (flake8) | ||
run: poetry run flake8 |
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.
Not to bikeshed (don't block on this) but I've found GitHub renders steps quite reasonably when names are omitted... wonder if we'd be better / equally served by pervasively doing:
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Poetry | |
uses: matrix-org/setup-python-poetry@v1 | |
- name: Import order (isort) | |
run: poetry run isort --check --diff . | |
- name: Code style (black) | |
run: poetry run black --check . | |
- name: Semantic checks (flake8) | |
run: poetry run flake8 | |
- uses: actions/checkout@v2 | |
- uses: matrix-org/setup-python-poetry@v1 | |
- run: poetry run isort --check --diff . | |
- run: poetry run black --check . | |
- run: poetry run flake8 |
This introduces two reusable workflows:
twine check
on the results.In the future I would also like to include an "automatically push releases to PyPI" action here.
To see this in action, see this CI run on this Sydent PR.