Start Newton 1.6 development #7796
Workflow file for this run
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
| name: Pull Request - AWS GPU Benchmarks | |
| on: | |
| pull_request_target: | |
| concurrency: | |
| group: ${{ github.workflow }}-pr-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| check-author-membership: | |
| name: Check Author Membership | |
| runs-on: ubuntu-latest | |
| permissions: {} | |
| outputs: | |
| membership_status: ${{ steps.check_org.outputs.membership_status }} | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: audit | |
| - name: Check user's organization membership | |
| id: check_org | |
| run: | | |
| ASSOCIATION="${{ github.event.pull_request.author_association }}" | |
| echo "Author's association with the repository: ${ASSOCIATION}" | |
| if [[ "${ASSOCIATION}" == "MEMBER" || "${ASSOCIATION}" == "OWNER" || "${ASSOCIATION}" == "COLLABORATOR" ]]; then | |
| echo "Author is a recognized member, owner, or collaborator." | |
| echo "membership_status=CONFIRMED_MEMBER" >> "$GITHUB_OUTPUT" | |
| else | |
| # Set the output for other jobs to use | |
| echo "membership_status=NOT_MEMBER" >> "$GITHUB_OUTPUT" | |
| # Print a message explaining the status and its impact on workflows. | |
| echo "--------------------------------------------------------------------------------" >&2 | |
| echo "Thank you for your contribution!" >&2 | |
| echo "This is the expected status for community contributors. Certain automated" >&2 | |
| echo "workflows are reserved for verified organization members." >&2 | |
| echo "" >&2 | |
| echo "--------------------------------------------------------------------------------" >&2 | |
| echo "❓ Are you a member of the 'newton-physics' organization and believe this is an error?" >&2 | |
| echo "" >&2 | |
| echo "This can happen if your organization membership is set to 'Private'. To fix this," >&2 | |
| echo "please make your membership 'Public' to enable all workflow triggers:" >&2 | |
| echo "" >&2 | |
| echo "1. Go to the organization's People page: https://github.com/orgs/newton-physics/people" >&2 | |
| echo "2. Find your username in the list." >&2 | |
| echo "3. Click the dropdown next to your name and change your visibility from 'Private' to 'Public'." >&2 | |
| echo "" >&2 | |
| echo "After updating your visibility, push a new commit to this PR to re-run the check." >&2 | |
| echo "--------------------------------------------------------------------------------" >&2 | |
| # Surface warnings as visible annotations (yellow banners in job view) | |
| echo "::warning::This PR requires manual approval before GPU benchmarks can run (author is not a recognized org member)." | |
| echo "::warning::If you are a newton-physics org member with private membership, make it public at https://github.com/orgs/newton-physics/people" | |
| # Write to job summary (appears in Summary tab) | |
| cat >> "$GITHUB_STEP_SUMMARY" << 'EOF' | |
| ## ⚠️ Manual Approval Required | |
| This PR was authored by an external contributor. GPU benchmarks require manual approval from a maintainer before they can run. | |
| ### Are you a newton-physics org member? | |
| If your membership is set to **Private**, the workflow cannot detect it. To fix: | |
| 1. Go to [newton-physics People](https://github.com/orgs/newton-physics/people) | |
| 2. Find your username and change visibility from **Private** to **Public** | |
| 3. Push a new commit to re-trigger the check | |
| EOF | |
| fi | |
| require-approval: | |
| name: Require Manual Approval for External PRs | |
| runs-on: ubuntu-latest | |
| permissions: | |
| deployments: write # Required for creating deployment record when using environment | |
| needs: check-author-membership | |
| if: needs.check-author-membership.outputs.membership_status != 'CONFIRMED_MEMBER' | |
| environment: | |
| name: external-pr-approval | |
| url: ${{ github.event.pull_request.html_url }} | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: audit | |
| - name: Approval granted | |
| run: echo "Manual approval granted for external PR" | |
| run-gpu-benchmarks: | |
| name: Run GPU Benchmarks | |
| needs: | |
| - check-author-membership | |
| - require-approval | |
| if: >- | |
| github.repository == 'newton-physics/newton' && | |
| !cancelled() && | |
| needs.check-author-membership.result == 'success' && | |
| ( | |
| needs.require-approval.result == 'success' || | |
| ( | |
| needs.require-approval.result == 'skipped' && | |
| needs.check-author-membership.outputs.membership_status == 'CONFIRMED_MEMBER' | |
| ) | |
| ) | |
| uses: ./.github/workflows/aws_gpu_benchmarks.yml | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| base_ref: ${{ github.event.pull_request.base.sha }} | |
| secrets: inherit | |
| permissions: | |
| id-token: write # Required for AWS OIDC authentication in start-runner/stop-runner | |
| contents: read # Required for checkout in all jobs |