# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). # All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause name: Installation Tests on: pull_request: types: [opened, synchronize, reopened] push: branches: - main - develop - release/** workflow_dispatch: inputs: base_image: description: 'Docker base image for the test container' required: false default: 'ubuntu:24.04' type: string test_filter: description: 'pytest -k filter expression (e.g. "uv" or "bugs")' default: '' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read pull-requests: read jobs: changes: name: Detect Changes runs-on: ubuntu-latest outputs: run_install_tests: ${{ steps.detect.outputs.run_install_tests }} steps: - id: detect env: GH_TOKEN: ${{ github.token }} PR_NUMBER: ${{ github.event.pull_request.number }} EVENT_NAME: ${{ github.event_name }} REPO: ${{ github.repository }} run: | set -euo pipefail # Installation tests run only when paths in the patterns table change. # Otherwise the test job skips via `if:` and reports green to branch # protection, which is why we don't use a workflow-level `paths:` # filter (a not-triggered required check would block the PR forever). patterns=( $'^apps/\tStandalone apps' $'^tools/\tBuild tooling' $'^source/\tLibrary source code' $'^\\.github/actions/run-package-tests/\tTest action' $'^\\.github/actions/install-ci-(collect|run)/\tInstall-ci composite actions' $'^\\.github/workflows/install-ci\\.yml$\tThis workflow file' $'^VERSION$\tVersion file' $'(^|/)pyproject\\.toml$\tPython project metadata' $'(^|/)environment\\.ya?ml$\tConda environment file' ) render_table() { local files="$1" entry regex desc count sample shown echo "| Pattern | What it covers | Matched files |" echo "|---|---|---|" for entry in "${patterns[@]}"; do IFS=$'\t' read -r regex desc <<< "$entry" # escape | so it doesn't end the markdown table cell mid-regex shown="${regex//|/\\|}" count=$(grep -cE "$regex" <<< "$files" || true) if [ "$count" -gt 0 ]; then sample=$(grep -m 3 -E "$regex" <<< "$files" | paste -sd ', ' -) [ "$count" -gt 3 ] && sample="$sample (and $((count - 3)) more)" echo "| \`$shown\` | $desc | $sample |" else echo "| \`$shown\` | $desc | - |" fi done } any_match() { local files="$1" entry regex for entry in "${patterns[@]}"; do IFS=$'\t' read -r regex _ <<< "$entry" if grep -qE "$regex" <<< "$files"; then return 0 fi done return 1 } decide() { local decision="$1" reason="$2" files="${3:-}" echo "Decision: run_install_tests=$decision ($reason)" echo "run_install_tests=$decision" >> "$GITHUB_OUTPUT" { if [ -n "$files" ]; then render_table "$files" fi } >> "$GITHUB_STEP_SUMMARY" } if [ "$EVENT_NAME" != "pull_request" ]; then decide true "non-PR event ($EVENT_NAME)" exit 0 fi if ! changed_files="$(gh api --paginate "repos/$REPO/pulls/$PR_NUMBER/files" --jq '.[].filename')"; then # Fail-safe: a transient API error must not block merge. Default to running. echo "::warning::Could not list changed files; defaulting to running tests" decide true "fail-safe (could not list changed files)" exit 0 fi printf '%s\n' "$changed_files" if any_match "$changed_files"; then decide true "relevant paths changed" "$changed_files" else decide false "no relevant paths changed" "$changed_files" fi install-tests-x86: name: Installation Tests (x86) needs: [changes] if: needs.changes.outputs.run_install_tests == 'true' runs-on: [self-hosted, gpu] timeout-minutes: 90 steps: - name: Checkout uses: actions/checkout@v6 - name: Show Collected Tests uses: ./.github/actions/install-ci-collect with: test-filter: ${{ inputs.test_filter }} - name: Run Tests uses: ./.github/actions/install-ci-run with: base-image: ${{ inputs.base_image || 'ubuntu:24.04' }} test-filter: ${{ inputs.test_filter }} install-tests-arm: name: Installation Tests (ARM) needs: [changes] if: needs.changes.outputs.run_install_tests == 'true' runs-on: [self-hosted, aarch64] timeout-minutes: 90 steps: - name: Checkout uses: actions/checkout@v6 - name: Show Collected Tests uses: ./.github/actions/install-ci-collect with: test-filter: ${{ inputs.test_filter }} - name: Run Tests uses: ./.github/actions/install-ci-run with: base-image: ${{ inputs.base_image || 'ubuntu:24.04' }} test-filter: ${{ inputs.test_filter }}