Add Actuator.State.assign() for odd-length graph capture (#4101) #2077
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: CI | |
| permissions: | |
| contents: read | |
| env: | |
| PYTHONFAULTHANDLER: "1" # Dump tracebacks on fatal signals (SIGSEGV, SIGABRT, etc.) | |
| on: | |
| workflow_call: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - v* | |
| branches: | |
| - main | |
| - release-* | |
| jobs: | |
| python-compatibility-test: | |
| if: github.event_name != 'push' || github.repository == 'newton-physics/newton' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: block | |
| allowed-endpoints: > | |
| download.pytorch.org:443 | |
| files.pythonhosted.org:443 | |
| github.com:443 | |
| pypi.nvidia.com:443 | |
| pypi.org:443 | |
| raw.githubusercontent.com:443 | |
| release-assets.githubusercontent.com:443 | |
| releases.astral.sh:443 | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| with: | |
| version: "0.11.26" | |
| - name: Test CI tooling | |
| run: uv run --no-project -m unittest discover -s scripts/ci/tests | |
| - name: Python compatibility (Python 3.10) | |
| run: uv run --python 3.10 python -m unittest newton.tests.test_python_compatibility | |
| - name: Python compatibility (Python 3.11) | |
| run: uv run --python 3.11 python -m unittest newton.tests.test_python_compatibility | |
| - name: Python compatibility (Python 3.12) | |
| run: uv run --python 3.12 python -m unittest newton.tests.test_python_compatibility | |
| - name: Python compatibility (Python 3.13) | |
| run: uv run --python 3.13 python -m unittest newton.tests.test_python_compatibility | |
| - name: Python compatibility (Python 3.14) | |
| run: uv run --python 3.14 python -m unittest newton.tests.test_python_compatibility | |
| dependency-install-test: | |
| needs: python-compatibility-test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| [ | |
| ubuntu-latest, | |
| ubuntu-24.04-arm, | |
| windows-latest, | |
| macos-latest, | |
| ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| with: | |
| version: "0.11.26" | |
| - name: Test dependency resolution (Python 3.10) | |
| run: uv sync --dry-run --python 3.10 --extra dev | |
| - name: Test dependency resolution (Python 3.11) | |
| run: uv sync --dry-run --python 3.11 --extra dev | |
| - name: Test dependency resolution (Python 3.12) | |
| run: uv sync --dry-run --python 3.12 --extra dev | |
| - name: Test dependency resolution (Python 3.13) | |
| run: uv sync --dry-run --python 3.13 --extra dev | |
| newton-unittests: | |
| needs: dependency-install-test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| [ | |
| ubuntu-latest, | |
| ubuntu-24.04-arm, | |
| windows-latest, | |
| macos-latest, | |
| ] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: ${{ matrix.os == 'macos-latest' && 120 || 60 }} | |
| env: | |
| OS: ${{ matrix.os }} | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Install system dependencies (Ubuntu ARM) | |
| if: matrix.os == 'ubuntu-24.04-arm' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| with: | |
| version: "0.11.26" | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version-file: ".python-version" | |
| - name: Restore Warp kernel cache | |
| if: github.event_name != 'merge_group' | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 | |
| with: | |
| path: | | |
| ~/.cache/warp | |
| ~/Library/Caches/warp | |
| ~\AppData\Local\NVIDIA\warp\Cache | |
| key: warp-kernels-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('uv.lock', 'newton/**/*.py') }} | |
| restore-keys: | | |
| warp-kernels-${{ runner.os }}-${{ runner.arch }}- | |
| - name: Run Tests | |
| env: | |
| PYTHONFAULTHANDLER: "1" | |
| # sys.monitoring coverage core: avoids settrace overhead in unmeasured code | |
| COVERAGE_CORE: "sysmon" | |
| run: > | |
| uv run --extra dev -m newton.tests | |
| --strict-warnings | |
| --parallel-timeout ${{ matrix.os == 'macos-latest' && 6900 || 3300 }} | |
| ${{ matrix.os == 'macos-latest' && '--disable-process-pooling' || '' }} | |
| --no-cache-clear | |
| --junit-report-xml rspec.xml | |
| --coverage | |
| --coverage-xml coverage.xml | |
| - name: Run ASV harness unit tests | |
| run: > | |
| uv run --no-sync -m newton.tests | |
| --strict-warnings | |
| --no-cache-clear | |
| --start-directory asv/tests | |
| --junit-report-xml asv-rspec.xml | |
| - name: Test Summary | |
| uses: test-summary/action@37b508cfee6d4d080eedd00b5bb240a6a784a6a5 # v2.6 | |
| with: | |
| paths: | | |
| rspec.xml | |
| asv-rspec.xml | |
| show: "fail" | |
| if: always() | |
| - name: Upload test results artifact | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: test-results-${{ matrix.os }} | |
| path: | | |
| rspec.xml | |
| asv-rspec.xml | |
| retention-days: 1 | |
| overwrite: true | |
| - name: Upload coverage artifact | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: coverage-${{ matrix.os }} | |
| path: coverage.xml | |
| retention-days: 1 | |
| overwrite: true | |
| codecov-upload: | |
| name: Upload reports to Codecov | |
| needs: newton-unittests | |
| if: ${{ !cancelled() && needs.newton-unittests.result != 'skipped' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| [ | |
| ubuntu-latest, | |
| ubuntu-24.04-arm, | |
| windows-latest, | |
| macos-latest, | |
| ] | |
| runs-on: ubuntu-latest | |
| # Same-run artifact downloads use the runtime token; contents access is | |
| # only used to build Codecov's source network for coverage path mapping. | |
| permissions: | |
| contents: read | |
| env: | |
| OS: ${{ matrix.os }} | |
| steps: | |
| # *.blob.core.windows.net is intentionally broad: GitHub artifact storage | |
| # uses rotating productionresultssaN hosts and harden-runner only supports | |
| # leading full-label wildcards. | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 | |
| with: | |
| egress-policy: block | |
| allowed-endpoints: > | |
| *.blob.core.windows.net:443 | |
| cli.codecov.io:443 | |
| github.com:443 | |
| ingest.codecov.io:443 | |
| keybase.io:443 | |
| o26192.ingest.us.sentry.io:443 | |
| results-receiver.actions.githubusercontent.com:443 | |
| storage.googleapis.com:443 | |
| - name: Checkout source for coverage path mapping | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| ref: ${{ github.sha }} | |
| persist-credentials: false | |
| sparse-checkout: | | |
| .github | |
| asv/tests | |
| newton | |
| - name: Download test results artifact | |
| id: download-test-results | |
| continue-on-error: true | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: test-results-${{ matrix.os }} | |
| - name: Download coverage artifact | |
| id: download-coverage | |
| continue-on-error: true | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: coverage-${{ matrix.os }} | |
| - name: Upload test results to Codecov | |
| if: ${{ steps.download-test-results.outcome == 'success' }} | |
| uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3 | |
| with: | |
| disable_search: true | |
| files: ./rspec.xml,./asv-rspec.xml | |
| report_type: test_results | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload coverage reports to Codecov | |
| if: ${{ steps.download-coverage.outcome == 'success' }} | |
| uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3 | |
| with: | |
| disable_search: true | |
| env_vars: OS | |
| files: ./coverage.xml | |
| flags: unittests | |
| plugins: noop | |
| token: ${{ secrets.CODECOV_TOKEN }} |