MHKiT-Software / MHKiT-Python

MHKiT-Python provides the marine renewable energy (MRE) community tools for data processing, visualization, quality control, resource assessment, and device performance.
https://mhkit-software.github.io/MHKiT/
BSD 3-Clause "New" or "Revised" License
47 stars 45 forks source link

Run hindcast tests only on change to hindcast module #270

Closed ssolson closed 8 months ago

ssolson commented 8 months ago

This Pull Request introduces a mechanism to selectively trigger the execution of expensive hindcast tests based on the context of the changes made. Specifically, the hindcast tests will only run under two scenarios:

  1. If there are changes made to the modules within the mhkit/wave/io/hindcast directory.
  2. If the merge request is targeted at the master branch.

To achieve this, a new job named check-changes has been added to the workflow, which precedes the prepare-cache job.

image

Here's how the check-changes job operates:

  1. Detecting Module Changes:
    • Check if any files within the mhkit/wave/io/hindcast directory have been altered.
      • If yes, set wave_io_hindcast_changed to true.
      • If no, set wave_io_hindcast_changed to false.
  2. Determining Hindcast Test Execution:
    • Check if the PR is against the master branch or if wave_io_hindcast_changed is true.
    • If either condition is met, set should-run-hindcast to true.
      • Otherwise, set should-run-hindcast to false.

Some additional minor modifications have been made to ensure the seamless integration of Coveralls reporting, regardless of whether the hindcast tests are executed or skipped.

ssolson commented 8 months ago

@akeeste can I request a quick review on this PR to help us move PRs through review quicker due to less time spent on hindcast calls?