-
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
Changes from all commits
ffce93e
9724a14
e17ce58
726fe6a
9258dbf
2f5a097
125ec15
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 |
---|---|---|
|
@@ -11,9 +11,18 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
timeout-minutes: 5 | ||
|
||
strategy: | ||
matrix: | ||
postgres-image: | ||
- "postgres:12" | ||
- "postgres:13" | ||
- "postgres:14" | ||
- "postgres:15" | ||
- "postgres:16" | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
image: ${{ matrix.postgres-image }} | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
options: >- | ||
|
@@ -24,23 +33,23 @@ jobs: | |
ports: | ||
- 5432:5432 | ||
|
||
strategy: | ||
matrix: | ||
python-version: ["3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- name: Clone the code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
- name: Set up Python versions | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python-version: | | ||
3.12 | ||
3.11 | ||
3.10 | ||
Comment on lines
+43
to
+46
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. Why all in one job rather than a job for each? 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. 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 commentThe 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. |
||
cache: 'pip' | ||
|
||
- name: Install requirements | ||
run: make install | ||
- name: Install tox | ||
run: pip install tox | ||
|
||
- name: Run the tests | ||
run: tox | ||
run: tox --parallel --parallel-no-spinner --skip-missing-interpreters=false | ||
env: | ||
DATABASE_URL: postgres://postgres:postgres@localhost/django_integrity |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Django is in the tox matrix already. |
||
- PostgreSQL 12 to 16 | ||
|
||
## Local development | ||
|
||
|
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.Ref: https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#specifying-multiple-pythonpypy-versions