Conversation
|
Being able to run CI in forks and on branches that don't have a PR is needed; adding developer documentation about how to do so from the GUI and with the (From memory it's something like |
|
Is this an acceptable compromise? That is, we provide developer documentation on how to trigger CI on a branch, but the CI no longer runs automatically on branches, only on PR:s? |
|
Ok, looking at this I think we should modify our At present, the concurrency we have is: As noted in the comment, this code acts to stop the CI if an update is pushed to a branch OR a pull request, with the run of the CI that is currently in progress cancelled in favour of the more recent one. I propose we extend this to also account for stopping the CI activated on push if a pull request is filed soon after the push. This then means that the CI will be run if there is a push but no PR, but only one version is run if a PR is opened immediately. This also means we don't have to give developers instructions to run CI manually as we won't make any changes to existing runs. The concurrency group I would define is: This then matches the format of the concurrency group for push and PR triggers, and should achieve what we want. See: https://docs.github.com/en/actions/reference/workflows-and-actions/variables |
|
See #2638 for when this was done orginally. |
|
Hmm, the concurrency is working as intended - in that the push job was stopped and the pull request job passed, but we have the stopped push job listed in the checks. Does anyone know how we can solve this? |
|
@DrPaulSharp The issue is that concurrency groups seem to cancel the jobs, counting them as failed checks. We could probably achieve the same using if-guards, which will instead make them count as skipped, not failed, meaning the workflow run can still count as passed. I don't think there's any way to completely remove skipped/cancelled jobs from the list. Example from my repo: |
|
@klytje Thank you, I agree that skipped looks better than cancelled, since cancelled is interpreted as failing. Can you please post a snippet or link to the workflow file for the repo? I am not sure I understand what you mean by if-guards. |
|
@klytje Ah I see. I think the problem is that a workflow job doesn't have access to information about other running jobs (at least through standard variables etc.). The |
|
@backmari Do we actually need the Default behaviour also includes |
|
@klytje My initial suggestion was to only trigger on We need to always trigger on |
|
@backmari But if we have: then it will still trigger whenever a PR is opened from a fork, no? |
|
This seems to eliminate some of the duplication. I wonder though if the CI will rerun if a new commit is pushed to a PR opened from a fork or if it will only run when first opened 🤔 |
|
@backmari Good question. Probably it will not since the branch does not belong to the repository? To support that case, we could perhaps fully re-enable That seems a little complicated though, so maybe someone else has a better idea... |
|
@klytje Thank you for the suggestion! I think this is the best solution so far. Since all other jobs depend on the |
Add comment explaining the purpose of the filtering job

Description
All pull request CI jobs are run twice, since the triggers are both
pushandpull_requestfor any branch. This change reduces the number of jobs run by half. The jobs will still be re-triggered if new commits are pushed.This change would, however, mean that one has to create a pull request to trigger the CI pipeline, or use the workflow dispatch functionality:
https://github.com/SasView/sasview/actions/workflows/ci.yml
Fixes # (issue/issues)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Review Checklist:
[if using the editor, use
[x]in place of[ ]to check a box]Documentation (check at least one)
Installers
Licensing (untick if necessary)