forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 225
Add an alternative Precommit workflow #7334
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
Open
Growl1234
wants to merge
7
commits into
deepmodeling:develop
Choose a base branch
from
Growl1234:make-pretty
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5610df2
Add an alternative Precommit workflow
Growl1234 d149a3f
Temporarily skip precommit failure
Growl1234 f460cad
Clean old precommit configuration
Growl1234 7592613
Add linebreak rules to .gitattributes
Growl1234 45cb3d3
Make pretty (docs/, cmake/, toolchain/)
Growl1234 319dfd2
Make pretty (interfaces/, tools/)
Growl1234 03cbb10
Remove messed header notes of CMake files
Growl1234 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| # Export-ignore | ||
| .gitattributes export-ignore | ||
| .gitignore export-ignore | ||
| .gitmodules export-ignore | ||
| .pre-commit-config.yaml export-ignore | ||
| .github/ export-ignore | ||
|
|
||
| # Line break | ||
| * text=auto eol=lf | ||
| *.bat text eol=crlf | ||
| *.cmd text eol=crlf |
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,51 @@ | ||
| name: Precommit | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Precommit | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| # We will handle submodules manually after fixing ownership | ||
| submodules: 'false' | ||
|
|
||
| - name: Update submodules | ||
| run: | | ||
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
| git submodule update --init --recursive | ||
|
|
||
| - name: Configure precommit server | ||
| run: | | ||
| cd tools/precommit | ||
| ./start_local_server.sh & | ||
|
|
||
| - name: Wait for precommit server | ||
| run: | | ||
| for i in {1..200}; do | ||
| if curl -fs -o /dev/null http://127.0.0.1:8080/ 2>/dev/null; then | ||
| echo "precommit server is ready" | ||
| exit 0 | ||
| fi | ||
| sleep 1 | ||
| done | ||
| echo "precommit server did not become ready" >&2 | ||
| exit 1 | ||
|
|
||
| - name: Run precommit | ||
| env: | ||
| ABACUS_PRECOMMIT_SERVER: "http://127.0.0.1:8080" | ||
| continue-on-error: true | ||
| run: | | ||
| ./tools/precommit/precommit.py --no-cache | ||
|
|
||
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.
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.
Uh oh!
There was an error while loading. Please reload this page.