From 17015d659a4c2fb29807947410d9e669db5c4f19 Mon Sep 17 00:00:00 2001 From: Sissi Feng Date: Thu, 3 Sep 2026 12:06:59 -0400 Subject: [PATCH] ci: run CPU validation on hosted runners --- .github/workflows/pre-commit.yaml | 19 ++++++++--- .github/workflows/unit-tests.yaml | 54 +++++++++++++++++-------------- 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index b7f0f1d..033141a 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -4,11 +4,22 @@ on: pull_request: push: branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: pre-commit-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: pre-commit: - runs-on: self-hosted + runs-on: ubuntu-latest + timeout-minutes: 15 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: pre-commit/action@v3.0.0 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 47bfb50..b9c2a33 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -5,39 +5,43 @@ on: branches: [ main ] pull_request: branches: [ main ] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: unit-tests-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: MatterixUnitTests: - runs-on: self-hosted - defaults: - run: - shell: bash - env: - DOCKER_HOST: unix:///var/run/docker.sock + # Isaac/Sim integration and rendering checks belong in a separate trusted GPU job. + runs-on: ubuntu-latest + timeout-minutes: 15 steps: - - - name: Checkout code + - name: Checkout repository uses: actions/checkout@v4 - - name: Verify Docker install - run: | - docker --version - docker info - - - name: Start Docker container - run: python3 docker/container.py start - - - name: Run command inside the container - run: | - CONTAINER_ID=$(docker ps -qf "name=isaac-lab-base") - docker exec $CONTAINER_ID bash -c "echo Hello from inside the container!" - docker exec $CONTAINER_ID bash -c "ls /workspace" + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: source/matterix_sm/pyproject.toml - - name: Stop container + - name: Install CPU test dependencies run: | - python3 docker/container.py stop + python -m pip install --upgrade pip + python -m pip install "numpy>=1.23" pytest + python -m pip install "torch==2.10.0" --index-url https://download.pytorch.org/whl/cpu + python -m pip install --editable source/matterix_sm --no-deps - - name: Clean workspace + - name: Run CPU unit tests run: | - rm -rf ./* .[^.]* + python -m pytest \ + -q \ + -p no:cacheprovider \ + source/matterix_sm/test \ + source/matterix/test