Skip to content

Commit 5bfc164

Browse files
Copilotpancetta
andauthored
[WIP] Fix CI triggering twice on PR and push (#603)
* Initial plan * Fix duplicate CI runs by limiting push trigger to master branch Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com> * Add documentation for CI workflow triggers Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com>
1 parent d3e0bb9 commit 5bfc164

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/ci_pipeline.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ name: CI pipeline for pySDC
44

55
on:
66
push:
7+
branches:
8+
- master
79
pull_request:
810
schedule:
911
- cron: '1 5 * * 1'

docs/contrib/02_continuous_integration.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ Any commit in `pySDC` are tested by GitHub continuous integration (CI). You can
44
Those tests are currently divided in three main categories : [code linting](#code-linting), [code testing](#code-testing) and [code coverage](#code-coverage).
55
Finally, the CI also build artifacts that are used to generate the documentation website (see http://parallel-in-time.org/pySDC/), more details given in the [documentation generation](#documentation-generation) section.
66

7+
## CI Workflow Triggers
8+
9+
The CI pipeline is configured to avoid redundant runs. The workflow is triggered:
10+
11+
- **On pull requests**: CI runs for all pull request events (opened, synchronized, reopened, etc.)
12+
- **On push to master**: CI runs when code is pushed directly to the `master` branch
13+
- **On schedule**: CI runs weekly on Monday at 5:01 AM UTC (via cron schedule)
14+
15+
This configuration ensures that when you push commits to a pull request branch, the CI runs only once for the pull request event, not twice (once for the PR and once for the push). Direct pushes to the master branch will still trigger the CI to ensure the main branch is always tested.
16+
717
## Code linting
818

919
Code style linting is performed using [black](https://black.readthedocs.io/en/stable/) and [ruff](https://docs.astral.sh/ruff/) for code syntax checking. In particular, `black` is used to check compliance with (most of) [PEP-8 guidelines](https://peps.python.org/pep-0008/).

0 commit comments

Comments
 (0)