-
Notifications
You must be signed in to change notification settings - Fork 0
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
Run multiple versions of PostgreSQL in CI build matrix #6
Conversation
a9a2628
to
87e275e
Compare
e855901
to
2f5a097
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.
I'd like more of an explanation of why we're doing a matrix for Postgres but putting all of the pythons in one job. I'm happy to believe you that it's faster, but a bit more detail would be reassuring
postgres-image: | ||
- "postgres:12" | ||
- "postgres:13" | ||
- "postgres:14" | ||
- "postgres:15" | ||
- "postgres:16" |
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.
(nitpick) why two different syntaxes for arrays?
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 removed the other array syntax (assuming you're asking about the old one-line python-version
). I prefer this one because diffs will be clearer when we change the supported versions.
If you're referring to the new multi-line definition for the python-version
, that's a different data structure. I'm not sure which, tbh. I copied it from the docs.
@@ -9,6 +9,7 @@ This package is tested against: | |||
|
|||
- Python 3.10, 3.11, or 3.12. | |||
- Django 4.1, 4.2, or 5.0. |
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.
(out of scope) should we add Django to the matrix, too?
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.
Django is in the tox matrix already.
python-version: | | ||
3.12 | ||
3.11 | ||
3.10 |
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.
Why all in one job rather than a job for each?
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.
When we do one job per python per postgres, the billable GHA time is 41 minutes.
When combining these and running them in parallel, it's just 15 minutes.
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.
Update: my latest commit avoids installing unused requirements, and gets that down to 12 minutes.
Tox is good at managing the different versions of Python and Django, so I'm happy to let it do that. Using it also allows us to run the tests in parallel, both locally and in CI. Tox wouldn't be great for running multiple versions of Postgres, so I've delegated that to GitHub Actions. I don't think it's going to be important (or convenient) for local development to run against a matrix of Postgres versions, so I don't think it's a significant loss. |
Before this change, we installed all the requirements used to run the tests, when we only needed tox. Tox would then install those same requirements in each of the virtual environments it created. This change installs only tox in CI, trusting that it's the only package required to run the tests.
This changes CI to run the tests against multiple versions of PostgreSQL.
To keep the build matrix low, and reduce CI time, we test all Python version at once with tox.