Repository navigation
Add domain randomization #367
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
| # Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: AutoData CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| # Cancel superseded runs on the same ref. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| pre_commit: | |
| name: Pre-commit | |
| # Lint-only job: no GPU needed, so keep it off the scarce self-hosted GPU pool. | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| steps: | |
| # Linting does not need the submodules; the hooks exclude submodules/. | |
| # No post-checkout git auth is needed here, so don't persist credentials | |
| # into the workspace that later (repo-controlled) steps could read. | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: false | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| # Run pre-commit directly rather than via pre-commit/action, which pins | |
| # actions/cache@v4 (Node 20, deprecated). We already point PRE_COMMIT_HOME | |
| # at a fresh dir, so the action's caching brings nothing here anyway. | |
| - name: Run pre-commit | |
| env: | |
| PRE_COMMIT_HOME: /tmp/pre-commit-cache | |
| run: | | |
| pip install --no-cache-dir pre-commit==4.6.0 | |
| pre-commit run --all-files --show-diff-on-failure --verbose | |
| uv_lock: | |
| name: uv lock | |
| # Needs no GPU, so unlike the GPU job it also runs for fork PRs. | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout (recursive submodules) | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| persist-credentials: false | |
| - name: Install uv | |
| run: | | |
| curl -LsSf https://astral.sh/uv/0.12.21/install.sh | env UV_INSTALL_DIR="${RUNNER_TEMP}/uv" UV_NO_MODIFY_PATH=1 sh | |
| echo "${RUNNER_TEMP}/uv" >> "${GITHUB_PATH}" | |
| - name: Check the lock | |
| run: | | |
| uv lock --locked | |
| uv run --locked --only-group dev pytest autodata_tests/utils/test_uv_lock.py autodata_tests/utils/test_native_ci.py | |
| native_changes: | |
| name: Detect native installation changes | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 5 | |
| outputs: | |
| native: ${{ github.event_name != 'pull_request' || steps.filter.outputs.native == 'true' }} | |
| steps: | |
| # The PR files API compares the full PR, including earlier commits. | |
| - uses: dorny/paths-filter@v3 | |
| if: github.event_name == 'pull_request' | |
| id: filter | |
| with: | |
| filters: | | |
| native: | |
| - 'pyproject.toml' | |
| - 'uv.lock' | |
| - 'uv.toml' | |
| - '.python-version' | |
| - '.gitmodules' | |
| - 'submodules/**' | |
| - '.dockerignore' | |
| - 'docker/**' | |
| - '.github/workflows/**' | |
| - 'scripts/**' | |
| - 'skills/**/scripts/**' | |
| - 'sitecustomize.py' | |
| - 'autodata_*/**' | |
| - 'conftest.py' | |
| - 'pytest.ini' | |
| - 'setup.cfg' | |
| native_tests: | |
| name: Native installation | |
| needs: [native_changes, pre_commit] | |
| if: >- | |
| needs.native_changes.outputs.native == 'true' && | |
| (github.event_name != 'pull_request' || | |
| github.event.pull_request.head.repo.full_name == github.repository) | |
| uses: ./.github/workflows/native.yml | |
| native_check: | |
| name: Native installation check | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 5 | |
| needs: [native_changes, native_tests] | |
| if: always() | |
| steps: | |
| - name: Check native installation result | |
| env: | |
| CHANGES_RESULT: ${{ needs.native_changes.result }} | |
| NATIVE_REQUIRED: ${{ needs.native_changes.outputs.native }} | |
| NATIVE_RESULT: ${{ needs.native_tests.result }} | |
| TRUSTED: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} | |
| run: | | |
| test "${CHANGES_RESULT}" = success | |
| case "${NATIVE_REQUIRED}" in | |
| true) | |
| if [ "${NATIVE_RESULT}" != success ]; then | |
| echo "Native installation tests must succeed; result: ${NATIVE_RESULT}." | |
| if [ "${TRUSTED}" = false ] && [ "${NATIVE_RESULT}" = skipped ]; then | |
| echo "Source/test, dependency/submodule, script, Docker, workflow, or Python/test configuration changes require native GPU testing." | |
| echo "Fork changes must proceed through a maintainer-controlled branch and PR in this repository." | |
| echo "A separate successful run does not unblock the original fork PR." | |
| fi | |
| exit 1 | |
| fi | |
| ;; | |
| false) | |
| test "${NATIVE_RESULT}" = skipped | |
| echo "No native installation changes." | |
| ;; | |
| *) exit 1 ;; | |
| esac | |
| docker_tests: | |
| name: Docker correctness tests (GPU) | |
| runs-on: [self-hosted, gpu] | |
| timeout-minutes: 120 | |
| needs: [pre_commit] | |
| # Skip GPU work for pull requests opened from forks (no secrets, untrusted code). | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | |
| # Premerge runs the correctness suites: e2e (GPU/Sim data-gen) plus interfaces, | |
| # core, and utils (CPU unit tests). The datagen_perf/ success-rate benchmarks (500 | |
| # trials each) are heavy and run in the nightly instead. No marker filter, so | |
| # both subprocess and unit tests run. | |
| env: | |
| FORCE_REBUILD: "true" | |
| TEST_PATH: "autodata_tests/e2e/ autodata_tests/interfaces/ autodata_tests/core/ autodata_tests/domain_randomization/ autodata_tests/utils/ autodata_tests/retargeting/ autodata_tests/metrics/" | |
| steps: | |
| - name: nvidia-smi | |
| run: nvidia-smi | |
| # Clear stale submodule symlinks/locks left by a previous run on the host. | |
| - name: Clean up submodules directory | |
| run: | | |
| rm -f .git/modules/submodules/IsaacLab-Arena/index.lock || true | |
| rm -rf submodules/* || true | |
| - name: Mark repo as safe for git | |
| run: git config --global --add safe.directory "$PWD" | |
| - name: Checkout (recursive submodules) | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| - name: Pull LFS test data | |
| run: | | |
| git lfs install --local | |
| git lfs pull | |
| - name: Run tests | |
| # The GPU runners are shared. Use an empty job-temporary Docker config so | |
| # stale credentials cannot override anonymous access to the public base image, | |
| # and this job cannot modify the runner's persistent Docker login. | |
| env: | |
| DOCKER_CONFIG: ${{ runner.temp }}/autodata-docker | |
| run: | | |
| mkdir -p "${DOCKER_CONFIG}" | |
| ./scripts/ci/run_tests.sh | |
| run_tests: | |
| # Preserve the required check name while gating both installation paths. | |
| name: Run tests (GPU, repo Docker) | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 5 | |
| needs: [pre_commit, uv_lock, native_check, docker_tests] | |
| if: always() | |
| steps: | |
| - name: Check all required test results | |
| env: | |
| PRE_COMMIT_RESULT: ${{ needs.pre_commit.result }} | |
| LOCK_RESULT: ${{ needs.uv_lock.result }} | |
| NATIVE_RESULT: ${{ needs.native_check.result }} | |
| DOCKER_RESULT: ${{ needs.docker_tests.result }} | |
| TRUSTED: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} | |
| run: | | |
| test "${PRE_COMMIT_RESULT}" = success | |
| test "${LOCK_RESULT}" = success | |
| test "${NATIVE_RESULT}" = success | |
| if [ "${TRUSTED}" = true ]; then | |
| test "${DOCKER_RESULT}" = success | |
| else | |
| test "${DOCKER_RESULT}" = skipped | |
| fi | |
| build_docs: | |
| name: Build docs | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: false | |
| lfs: true | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Build docs | |
| run: | | |
| pip install --no-cache-dir -r docs/requirements.txt | |
| make -C docs html SPHINXOPTS=-W |