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

Run pytest with different Python versions in GitHub actions #1033

Merged
merged 17 commits into from
Feb 19, 2022
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


LucyJimenez marked this conversation as resolved.
Show resolved Hide resolved
name: CI

on: [push, pull_request]
Expand All @@ -6,6 +8,10 @@ jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
Copy link
Member

Choose a reason for hiding this comment

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

Just the first and the last versions should be enough. Too many builds add noise and consume resources. Or we may want to add something else to the matrix (like CPython/PyPy), and then the matrix will explode (like 8 builds just for that change.


steps:
- name: Checkout source
uses: actions/checkout@v2
Expand All @@ -19,4 +25,4 @@ jobs:
run: flake8 .
Copy link
Member

Choose a reason for hiding this comment

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

I think it's probably better to have flake8 and pytest in separate builds. Doesn't make so much sense to test flake8 in different Python versions.

Copy link
Member

Choose a reason for hiding this comment

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

Agree perhaps we could use precommit similar to pandas? https://github.com/pandas-dev/pandas/blob/main/.github/workflows/code-checks.yml#L35 but also happy to not overcomplicate things for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the recommendations, I’m going to implement it.


- name: Run tests
run: pytest
run: pytest