-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[Github] Add initial version of precommit checks #80951
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 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: "Precommit tests" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - '.github/workflows/precommit.yaml' | ||
| - 'llvm/**' | ||
|
|
||
boomanaiden154 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| jobs: | ||
| build-llvm: | ||
boomanaiden154 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| name: "Build and test LLVM" | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ghcr.io/llvm/ci-ubuntu-22.04:latest | ||
| steps: | ||
| - name: Fetch LLVM sources | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
| - name: Setup ccache | ||
| uses: hendrikmuhs/ccache-action@v1 | ||
| with: | ||
| max-size: 500M | ||
| variant: sccache | ||
| key: precommit-linux | ||
boomanaiden154 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Configure LLVM | ||
| run: | | ||
| cmake -B llvm-build -GNinja \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_C_COMPILER_LAUNCHER=sccache \ | ||
| -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ | ||
| -DLLVM_ENABLE_ASSERTIONS=ON \ | ||
| -DCMAKE_C_COMPILER=clang \ | ||
| -DCMAKE_CXX_COMPILER=clang++ \ | ||
| -DLLVM_LIT_ARGS="-v --no-progress-bar" \ | ||
| ./llvm | ||
boomanaiden154 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - name: Build LLVM | ||
| run: | | ||
| ninja -C llvm-build llvm-test-depends | ||
| - name: Check LLVM | ||
| run: | | ||
| ninja -C llvm-build check-llvm | ||
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.
Do you think we'll be able to use the same file for Windows testing? If not, I would call this "Linux Precommit Tests" and change the filename too.
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.
I'm planning on a separate file per OS. Github doesn't have native
runs-onsupport for containers on Windows, so we'll have to run the docker commands explicitly. The container image would need to be different either way, which means we would at least need separate jobs. I'm hoping to make sure common parts are pulled out into something common, but the OSes are different (at least as exposed to GHA for the way I want to use it).