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

CI: Run tests on GHA, using Anaconda #138

Closed
wants to merge 4 commits into from

Conversation

amotl
Copy link
Contributor

@amotl amotl commented Jan 7, 2023

Dear Brian,

this is a first stab at GH-100, using Anaconda for setting up the sandbox environment. See also [1] for an example run.

image

With kind regards,
Andreas.

[1] https://github.com/earthobservations/Herbie/actions/runs/3861815012/usage

Comment on lines -31 to -33

- pip:
- herbie-data
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've used the environment-test.yml file to setup the Conda environment, because it was already close to what was needed there. I see that you might have been using it differently, because it installed the herbie-data package from PyPI. However, on CI, when running code from a pull request, the code from the repository should be used.

Let me know if you can adjust your workflow, or if you have other suggestions.

env:
TMPDIR: ${{ runner.temp }}
run: |
pytest -vvv -k test_ecmwf
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just running a single test here for the sake of saving resources while iterating on the baseline setup, and to see the full test matrix succeed faster. It think it can be adjusted within a subsequent iteration, after seeing the test suite succeed on your end.

Comment on lines +20 to +31
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11"]
# In order to save resources, only run particular
# matrix slots on other OS than Linux.
include:
- os: "macos-latest"
python-version: "3.11"
- os: "windows-latest"
python-version: "3.11"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know if you want to see any adjustments to the test matrix configuration.

I've not added Python 3.8 here, in order to save resources, and, in a similar spirit, the recipe will only run a single version of Python on non-Linux operating systems. I see that you designated Python 3.10 to be the "default" version supported by Herbie, but I think it is safe to bump that to Python 3.11.

On regular operations, you would toggle to fail-fast: true, in order to save further resources: It will cancel other jobs when a test job fails on one test matrix slot, because it does not make sense to continue running them.

Using fail-fast: false makes sense when working on the workflow recipe itself, in order to get the big picture if specific tests would only fail on Windows, for example, and you don't want them to cancel the jobs running on Linux.

@amotl amotl marked this pull request as ready for review January 7, 2023 11:50
@amotl amotl marked this pull request as draft January 7, 2023 13:05
@amotl amotl mentioned this pull request Jan 7, 2023
@amotl
Copy link
Contributor Author

amotl commented Jan 7, 2023

Closing this in favor of GH-139. It will use less resources, and still provide reasonable coverage of platform/environments.

@amotl amotl closed this Jan 7, 2023
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.

None yet

1 participant