-
Notifications
You must be signed in to change notification settings - Fork 2.4k
ci: Add PR test workflow #261
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1154c0a
add PR CI workflows
jayavenkatesh19 6c84306
changed npm to install
jayavenkatesh19 6ea7be1
merged both PR checks into one
jayavenkatesh19 8b585c6
Merge pull request #2 from NVIDIA/main
jayavenkatesh19 87f6046
moved variables from run to env
jayavenkatesh19 ab72e1c
scoping read permissions
jayavenkatesh19 6fd1ffd
split pr closer into a separate file
jayavenkatesh19 e22af20
changed action to pull_request_target
jayavenkatesh19 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,40 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: pr-limit | ||
|
|
||
| # pull_request_target runs in the base repo context, giving the token write | ||
| # access even for fork PRs. This is safe here because this workflow never | ||
| # checks out or executes code from the PR — it only counts open PRs and | ||
| # closes excess ones. Do NOT add a checkout step or run PR-sourced code | ||
| # in this workflow to prevent injection attacks. | ||
| on: | ||
| pull_request_target: | ||
| types: [opened, reopened] | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| check-pr-limit: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Check open PR count for author | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| AUTHOR: ${{ github.event.pull_request.user.login }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| REPO: ${{ github.repository }} | ||
| run: | | ||
| OPEN_COUNT=$(gh pr list --repo "$REPO" --author "$AUTHOR" --state open --json number --jq 'length') | ||
|
|
||
| echo "Author $AUTHOR has $OPEN_COUNT open PR(s)" | ||
|
|
||
| if [ "$OPEN_COUNT" -gt 10 ]; then | ||
| gh pr comment "$PR_NUMBER" --repo "$REPO" --body \ | ||
| "This repository limits contributors to 10 open pull requests. Please close or merge existing PRs before opening new ones." | ||
| gh pr close "$PR_NUMBER" --repo "$REPO" | ||
| echo "::error::PR closed — author $AUTHOR exceeds the 10 open PR limit" | ||
| 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,58 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: pr | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test-unit: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "22" | ||
| cache: npm | ||
|
|
||
| - name: Install root dependencies | ||
| run: npm install | ||
|
|
||
| - name: Install and build TypeScript plugin | ||
| working-directory: nemoclaw | ||
| run: | | ||
| npm install | ||
| npm run build | ||
|
|
||
| - name: Run root unit tests | ||
| run: node --test test/*.test.js | ||
|
|
||
| - name: Run TypeScript unit tests | ||
| working-directory: nemoclaw | ||
| run: npx vitest run | ||
|
|
||
| test-e2e-sandbox: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Build sandbox test image | ||
| run: docker build -f test/Dockerfile.sandbox -t nemoclaw-sandbox-test . | ||
|
|
||
| - name: Run sandbox E2E tests | ||
| run: docker run --rm -v "${{ github.workspace }}/test:/opt/test" nemoclaw-sandbox-test /opt/test/e2e-test.sh | ||
|
jacobtomlinson marked this conversation as resolved.
|
||
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.