deepcharles / ruptures

ruptures: change point detection in Python
BSD 2-Clause "Simplified" License
1.61k stars 163 forks source link

ci: do not triggers some gh actions for pre-commit-ci-update-config branch #186

Closed oboulant closed 3 years ago

oboulant commented 3 years ago

The situation :

As of today, for the PRs automatically generated by pre-commit-ci from branch pre-commit-ci-update-config to master and only affecting .pre-commit-config.yaml, run all the CI tests like any other PRs.

What we do :

When only .pre-commit-config.yaml is affected by the PR, then the following Gh Actions are not run :

codecov[bot] commented 3 years ago

Codecov Report

Merging #186 (fa42cb0) into master (d211c5c) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #186   +/-   ##
=======================================
  Coverage   96.31%   96.31%           
=======================================
  Files          40       40           
  Lines         978      978           
=======================================
  Hits          942      942           
  Misses         36       36           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d211c5c...fa42cb0. Read the comment docs.

oboulant commented 3 years ago

As can be seen in the commits, I tested several approaches :

This solution does not work because we do not have the guarantee that the PR is labelled before the jobs are started.... Moreover, the jobs are started regardless of the conditions, it is just that if the condition is met, then we skip the following steps

Might work but still, the jobs are started, it is just that the steps after the condition are ignored

If the PR only modifies .pre-commit-config.yaml, then jobs are ignored.

deepcharles commented 3 years ago

Does it work now? I am a bit lost

oboulant commented 3 years ago

Does it work now? I am a bit lost

Yes it does. I try to explain everything I tried in this comment from the current PR.

Bottom line, yes the PR is ready. And basically what it does is the following : for any newly created PR, if the PR consists only in a modification in .pre-commit-config.yaml, then we do not run the workflows I mentioned.

By doing so, we can for instance avoid running tests for the automatically created PR from pre-commit-ci.

Let me know if unclear !

deepcharles commented 3 years ago

Oh ok cool.