Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 94 additions & 6 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ name: Build PIP Wheel
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'apps/**'
- 'VERSION'
- 'source/**'
- 'tools/wheel_builder/**'
- '.github/workflows/wheel.yml'
push:
branches:
- main
Expand All @@ -26,6 +20,7 @@ concurrency:

permissions:
contents: read
pull-requests: read

jobs:
build-wheel:
Expand All @@ -34,13 +29,103 @@ jobs:
timeout-minutes: 5

steps:
- name: Detect wheel-relevant changes
id: changes
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
EVENT_NAME: ${{ github.event_name }}
REPO: ${{ github.repository }}
run: |
set -euo pipefail

# Keep this workflow unconditionally triggered on PRs so required
# branch-protection checks are always reported. The build steps below
# run only when inputs that can affect the wheel have changed.
patterns=(
$'^apps/\tStandalone apps packaged in the wheel'
$'^VERSION$\tPackage version'
$'^source/\tPython packages'
$'^tools/wheel_builder/\tWheel build tooling'
$'^\.github/workflows/wheel\.yml$\tThis workflow file'
)

render_table() {
local files="$1" entry regex desc count sample
echo "| Pattern | What it covers | Matched files |"
echo "|---|---|---|"
for entry in "${patterns[@]}"; do
IFS=$'\t' read -r regex desc <<< "$entry"
count=$(printf '%s\n' "$files" | grep -cE "$regex" || true)
if [ "$count" -gt 0 ]; then
sample=$(printf '%s\n' "$files" | grep -E "$regex" | head -3 | paste -sd ', ' -)
[ "$count" -gt 3 ] && sample="$sample (and $((count - 3)) more)"
echo "| \`$regex\` | $desc | $sample |"
else
echo "| \`$regex\` | $desc | - |"
fi
done
}

any_match() {
local files="$1" entry regex
for entry in "${patterns[@]}"; do
IFS=$'\t' read -r regex _ <<< "$entry"
if printf '%s\n' "$files" | grep -qE "$regex"; then
return 0
fi
done
return 1
}

decide() {
local decision="$1" reason="$2" files="${3:-}"
echo "run_build=$decision" >> "$GITHUB_OUTPUT"
{
echo "## Wheel build gating"
echo ""
if [ "$decision" = "true" ]; then
echo "The wheel build will **run**: $reason."
else
echo "The wheel build will be **skipped**: $reason."
fi
if [ -n "$files" ]; then
echo ""
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
echo "::warning::Could not list changed files; defaulting to building the wheel"
decide true "fail-safe (could not list changed files)"
exit 0
fi

if any_match "$changed_files"; then
decide true "wheel-relevant paths changed" "$changed_files"
else
decide false "no wheel-relevant paths changed" "$changed_files"
fi

- name: Skip wheel build
if: steps.changes.outputs.run_build == 'false'
run: echo "Skipping wheel build because this PR does not change wheel inputs."

- name: Checkout code
if: steps.changes.outputs.run_build == 'true'
uses: actions/checkout@v6
with:
fetch-depth: 1
lfs: true

- name: Setup Python
if: steps.changes.outputs.run_build == 'true'
uses: actions/setup-python@v5
with:
python-version: "3.12"
Expand All @@ -51,6 +136,7 @@ jobs:
# isaaclab-<VERSION>-build<RUN_NUMBER>-<SHA7>. The wheel inside follows
# PEP 440 (VERSION+buildN.SHA7) since pip requires that format.
- name: Compute wheel metadata
if: steps.changes.outputs.run_build == 'true'
id: meta
run: |
set -euo pipefail
Expand All @@ -59,12 +145,14 @@ jobs:
echo "artifact_name=isaaclab-${version}-build${{ github.run_number }}-${sha_slug}" >> "$GITHUB_OUTPUT"

- name: Build wheel
if: steps.changes.outputs.run_build == 'true'
env:
WHEEL_BUILD_NUMBER: ${{ github.run_number }}
WHEEL_SHA: ${{ github.sha }}
run: bash tools/wheel_builder/build.sh

- name: Upload wheel artifact
if: steps.changes.outputs.run_build == 'true'
uses: actions/upload-artifact@v7
with:
name: ${{ steps.meta.outputs.artifact_name }}
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ Table of Contents

source/experimental-features/bleeding-edge
source/experimental-features/newton-physics-integration/index
source/experimental-features/visuo_tactile_sensor

.. toctree::
:maxdepth: 1
Expand Down
Binary file removed docs/source/_static/setup/ecosystem-dark.jpg
Binary file not shown.
93 changes: 93 additions & 0 deletions docs/source/_static/setup/ecosystem-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/source/_static/setup/ecosystem-light.jpg
Binary file not shown.
Loading
Loading