-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[DEVOPS-3735] ci: github actions for PR static check #31330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
35ce72c
WIP - automation testing
svarnau 04c1a47
add PR checks, remove PR builds
svarnau 861102f
reduced lint rule
svarnau 3190c42
move lint to separate file to change event triggers
svarnau 7ccfb46
lint file
svarnau 9957c6d
lint file
svarnau 6799c40
move lint action file
svarnau 4b42e9a
Please enter the commit message for your changes. Lines starting
svarnau 07d473c
fix stray quote
svarnau 5e82713
fix docker options
svarnau 6367c5b
ybci user and stray quote
svarnau b956caf
regex for bash ERE
svarnau 6e5b0d2
debug path
svarnau ad5a54b
fix quoting in docker script
svarnau 74095ec
safe dir git config
svarnau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: "Check PR Title" | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, edited] | ||
| paths-ignore: | ||
| - README.md | ||
| - 'docs/**' | ||
|
|
||
| jobs: | ||
| gh-pr-title: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check PR title | ||
| run: | | ||
| TITLE_RE='^(\[(BACKPORT )?(\d+(\.\d+)+)\])?' | ||
| TITLE_RE+='\[((#\d+(,#[0-9]+)*)|([A-Z]+-[0-9]+(,[A-Z]+-[0-9]+)*))\]' | ||
| TITLE_RE+=' [a-zA-Z0-9_-]+(,[[a-zA-Z0-9_]-]+)*:' | ||
| TITLE_RE+=' \S.{8,98}\S$' | ||
|
|
||
| if [[ ! "${{ github.event.pull_request.title }}" =~ $TITLE_RE ]]; then | ||
| echo "::error ::PR title must include issue ID, code area (no extra whitespace), and short description.)" | ||
| echo "::error :: [#12345,#12367] area: Cool feature xyz" | ||
| echo "::error :: [BACKPORT branch][#12345] area1,area2: Must have fix" | ||
| echo "::error ::Issue referenced must be a github issue or YB-internal Jira ID" | ||
| echo "::error ::Short description must be less than 100 characters." | ||
| echo "::error ::Backport branch should be used only for non-master release branches." | ||
| exit 1 | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: "Lint" | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, edited ] | ||
| paths-ignore: | ||
| - README.md | ||
| - 'docs/**' | ||
|
|
||
| jobs: | ||
| gh-lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| fetch-tags: 'false' | ||
|
|
||
| - name: Lint | ||
| run: | | ||
| docker run \ | ||
| --user yugabyteci \ | ||
| -v "$(pwd):$(pwd)" \ | ||
| -w "$(pwd)" \ | ||
| yugabyteci/yb_build_infra_ubuntu2204_x86_64:latest \ | ||
| bash -c ' | ||
| set -euo pipefail | ||
| export PATH=/usr/local/bin:$HOME/yb-cpplint/cpplint:$PATH | ||
| echo ::group::Lint | ||
| # Base reference should not be set for non-PR actions. | ||
| set -x | ||
| git config --global --add safe.directory $(pwd) | ||
| if [[ -n "${{ github.base_ref }}" ]]; then | ||
| echo Base reference: ${{ github.base_ref }} | ||
| git fetch origin ${{ github.base_ref }} | ||
| ./build-support/lint.py --rev origin/${{ github.base_ref }} | ||
| else | ||
| echo No base reference: Skipping Lint Step | ||
| exit 1 | ||
| fi | ||
| ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unconditional
exit 1statement will cause all Jenkins builds to fail immediately. This code appears to be for testing purposes and must be removed before merging to avoid breaking the CI/CD pipeline.