Skip to content

RSL-RL dependency switch to UW-Lab organization #15

RSL-RL dependency switch to UW-Lab organization

RSL-RL dependency switch to UW-Lab organization #15

Workflow file for this run

# Copyright (c) 2024-2026, The UW Lab Project Developers. (https://github.com/uw-lab/UWLab/blob/main/CONTRIBUTORS.md).
# All Rights Reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
name: Build and Test
on:
pull_request:
branches:
- devel
- main
- 'release/**'
# Concurrency control to prevent parallel runs on the same PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
checks: write
issues: read
env:
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
ISAACSIM_BASE_IMAGE: ${{ vars.ISAACSIM_BASE_IMAGE || 'nvcr.io/nvidia/isaac-sim' }}
ISAACSIM_BASE_VERSION: ${{ vars.ISAACSIM_BASE_VERSION || '5.1.0' }}
DOCKER_IMAGE_TAG: uw-lab-dev:${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}-${{ github.sha }}
jobs:
test-uwlab-tasks:
runs-on: [self-hosted, gpu, 24g]
timeout-minutes: 180
continue-on-error: true
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Remove previous uw-lab-dev images
run: |
IDS=$(docker image ls -q uw-lab-dev 2>/dev/null || true)
if [ -n "$IDS" ]; then
echo "Removing existing uw-lab-dev images: $IDS"
docker image rm -f $IDS || true
else
echo "No existing uw-lab-dev images to remove."
fi
- name: Build Docker Image
uses: ./.github/actions/docker-build
with:
image-tag: ${{ env.DOCKER_IMAGE_TAG }}
isaacsim-base-image: ${{ env.ISAACSIM_BASE_IMAGE }}
isaacsim-version: ${{ env.ISAACSIM_BASE_VERSION }}
- name: Run UWLab Tasks Tests
uses: ./.github/actions/run-tests
with:
test-path: "tools"
result-file: "uwlab-tasks-report.xml"
container-name: "uw-lab-tasks-test-$$"
image-tag: ${{ env.DOCKER_IMAGE_TAG }}
pytest-options: ""
filter-pattern: "uwlab_tasks"
- name: Copy Test Results from UWLab Tasks Container
run: |
CONTAINER_NAME="uw-lab-tasks-test-$$"
if docker ps -a | grep -q $CONTAINER_NAME; then
echo "Copying test results from UWLab Tasks container..."
docker cp $CONTAINER_NAME:/workspace/uwlab/tests/uwlab-tasks-report.xml reports/ 2>/dev/null || echo "No test results to copy from UWLab Tasks container"
fi
- name: Upload UWLab Tasks Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: uwlab-tasks-test-results
path: reports/uwlab-tasks-report.xml
retention-days: 1
compression-level: 9
- name: Check Test Results for Fork PRs
if: github.event.pull_request.head.repo.full_name != github.repository
run: |
if [ -f "reports/uwlab-tasks-report.xml" ]; then
# Check if the test results contain any failures
if grep -q 'failures="[1-9]' reports/uwlab-tasks-report.xml || grep -q 'errors="[1-9]' reports/uwlab-tasks-report.xml; then
echo "Tests failed for PR from fork. The test report is in the logs. Failing the job."
exit 1
fi
else
echo "No test results file found. This might indicate test execution failed."
exit 1
fi
test-general:
runs-on: [self-hosted, gpu]
timeout-minutes: 180
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Remove previous uw-lab-dev images
run: |
IDS=$(docker image ls -q uw-lab-dev 2>/dev/null || true)
if [ -n "$IDS" ]; then
echo "Removing existing uw-lab-dev images: $IDS"
docker image rm -f $IDS || true
else
echo "No existing uw-lab-dev images to remove."
fi
- name: Build Docker Image
uses: ./.github/actions/docker-build
with:
image-tag: ${{ env.DOCKER_IMAGE_TAG }}
isaacsim-base-image: ${{ env.ISAACSIM_BASE_IMAGE }}
isaacsim-version: ${{ env.ISAACSIM_BASE_VERSION }}
- name: Run General Tests
id: run-general-tests
uses: ./.github/actions/run-tests
with:
test-path: "tools"
result-file: "general-tests-report.xml"
container-name: "uw-lab-general-test-$$"
image-tag: ${{ env.DOCKER_IMAGE_TAG }}
pytest-options: ""
filter-pattern: "not uwlab_tasks"
- name: Copy Test Results from General Tests Container
run: |
CONTAINER_NAME="uw-lab-general-test-$$"
if docker ps -a | grep -q $CONTAINER_NAME; then
echo "Copying test results from General Tests container..."
docker cp $CONTAINER_NAME:/workspace/uwlab/tests/general-tests-report.xml reports/ 2>/dev/null || echo "No test results to copy from General Tests container"
fi
- name: Upload General Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: general-test-results
path: reports/general-tests-report.xml
retention-days: 1
compression-level: 9
- name: Check Test Results for Fork PRs
if: github.event.pull_request.head.repo.full_name != github.repository
run: |
if [ -f "reports/general-tests-report.xml" ]; then
# Check if the test results contain any failures
if grep -q 'failures="[1-9]' reports/general-tests-report.xml || grep -q 'errors="[1-9]' reports/general-tests-report.xml; then
echo "Tests failed for PR from fork. The test report is in the logs. Failing the job."
exit 1
fi
else
echo "No test results file found. This might indicate test execution failed."
exit 1
fi
combine-results:
needs: [test-uwlab-tasks, test-general]
runs-on: [self-hosted, gpu]
if: always()
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: false
- name: Create Reports Directory
run: |
mkdir -p reports
- name: Download Test Results
uses: actions/download-artifact@v4
with:
name: uwlab-tasks-test-results
path: reports/
continue-on-error: true
- name: Download General Test Results
uses: actions/download-artifact@v4
with:
name: general-test-results
path: reports/
- name: Combine All Test Results
uses: ./.github/actions/combine-results
with:
tests-dir: "reports"
output-file: "reports/combined-results.xml"
- name: Upload Combined Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: pr-${{ github.event.pull_request.number }}-combined-test-results
path: reports/combined-results.xml
retention-days: 7
compression-level: 9
- name: Comment on Test Results
id: test-reporter
if: github.event.pull_request.head.repo.full_name == github.repository
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: "reports/combined-results.xml"
check_name: "Tests Summary"
comment_mode: changes
comment_title: "Test Results Summary"
report_individual_runs: false
deduplicate_classes_by_file_name: true
compare_to_earlier_commit: true
fail_on: errors
action_fail_on_inconclusive: true
- name: Report Test Results
if: github.event.pull_request.head.repo.full_name == github.repository
uses: dorny/test-reporter@v1
with:
name: UWLab Build and Test Results
path: reports/combined-results.xml
reporter: java-junit
fail-on-error: true
only-summary: false
max-annotations: '50'
report-title: "UWLab Test Results - ${{ github.workflow }}"