Skip to content

Commit

Permalink
Merge pull request #542 from elBoberido/iox2-3-skip-CI-for-draft-pr
Browse files Browse the repository at this point in the history
[#3] Trigger CI when a PR changes from draft to ready
  • Loading branch information
elBoberido authored Dec 4, 2024
2 parents 0ad8d53 + d6dfbf3 commit b1d41bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
22 changes: 8 additions & 14 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
<!-- markdownlint-disable MD041 first-line-heading/first-line-h1 -->
<!-- markdownlint-disable MD013 Line breaks on the bullet list lines are also present on the github renderer, therefore no line length limitation -->
<!-- markdownlint-disable MD041 On the github PR template we want to start with '## Headline' -->

## Notes for Reviewer
<!-- Items in addition to the checklist below that the reviewer should look for -->

## Prevent CI from running on each commit while the work is still in progress

* Set the PR to a draft status, e.g. by the `Convert to draft` link, to indicate
that the work is not yet ready for review
* Once the PR is ready for review, press the `Ready for Review` button and push
a final commit to trigger the CI

## Pre-Review Checklist for the PR Author

* [ ] Add sensible notes for the reviewer
* [ ] PR title is short, expressive and meaningful
* [ ] Consider switching the PR to a draft (`Convert to draft`)
* as draft PR, the CI will be skipped for pushes
* [ ] Relevant issues are linked in the [References](#references) section
* [ ] Every source code file has a copyright header with
`SPDX-License-Identifier: Apache-2.0 OR MIT`
* [ ] Every source code file has a copyright header with `SPDX-License-Identifier: Apache-2.0 OR MIT`
* [ ] Branch follows the naming format (`iox2-123-introduce-posix-ipc-example`)
* [ ] Commits messages are according to this [guideline][commit-guidelines]
* [ ] Commit messages have the issue ID (`[#123] Add posix ipc example`)
* [ ] Commit author matches [Eclipse Contributor Agreement][eca](and ECA is signed)
* [ ] Tests follow the [best practice for testing][testing]
* [ ] Changelog updated [in the unreleased section][changelog] including API
breaking changes
* [ ] Changelog updated [in the unreleased section][changelog] including API breaking changes
* [ ] Assign PR to reviewer
* [ ] All checks have passed (except `task-list-completed`)

Expand All @@ -45,9 +39,9 @@ breaking changes

## References

<!-- Use either 'Closes #123' or 'Relates to #123' to reference the corresponding
issue. -->
<!-- Use either 'Closes #123' or 'Relates to #123' to reference the corresponding issue. -->

Closes # <!-- Add issue number after '#' -->

<!-- markdownlint-enable MD041 -->
<!-- markdownlint-enable MD013 -->
14 changes: 2 additions & 12 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,15 @@ on:
branches: [ main ]
pull_request:
branches: [ main, release* ]
types: [ opened, ready_for_review, reopened, synchronize ]

# env:
# RUSTFLAGS: "-C debug-assertions"

jobs:
check_draft_pr:
runs-on: ubuntu-latest
steps:
- name: Check if PR is a draft
run: |
if [ "${{ github.event.pull_request.draft }}" == "true" ]; then
echo "PR is a draft. CI will not proceed."
exit 1 # Abort the CI job
else
echo "PR is not a draft. Proceeding with CI."
fi

changes:
needs: check_draft_pr
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
permissions:
pull-requests: read
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/miri-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches: [ main ]
pull_request:
branches: [ main, release* ]
types: [ opened, ready_for_review, reopened, synchronize ]

jobs:
miri:
name: "Miri"
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -23,4 +25,4 @@ jobs:
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: ./internal/scripts/ci_run_miri.sh
run: ./internal/scripts/ci_run_miri.sh

0 comments on commit b1d41bb

Please sign in to comment.