From 0eb43af2682984ca2dd5e61755ab78809a8fb4d7 Mon Sep 17 00:00:00 2001 From: vmoens Date: Wed, 28 Jan 2026 10:35:15 +0000 Subject: [PATCH] Update [ghstack-poisoned] --- .github/workflows/benchmarks_pr.yml | 11 +++++++++++ .github/workflows/docs.yml | 12 ++++++++++++ .github/workflows/test-linux-sota.yml | 12 ++++++++++++ 3 files changed, 35 insertions(+) diff --git a/.github/workflows/benchmarks_pr.yml b/.github/workflows/benchmarks_pr.yml index cfdcfd8d54c..b91de33530b 100644 --- a/.github/workflows/benchmarks_pr.yml +++ b/.github/workflows/benchmarks_pr.yml @@ -1,6 +1,12 @@ +# Continuous benchmarking for PRs +# +# Only runs when Performance or benchmarks/upload label is present. +# This is expensive (GPU, runs twice for CPU/GPU comparison). +# Add the label manually or use [Performance] prefix in PR title. name: Continuous Benchmark (PR) on: pull_request: + types: [opened, synchronize, labeled] permissions: write-all @@ -13,6 +19,11 @@ concurrency: jobs: benchmark: + # Only run benchmarks when Performance or benchmarks/upload label is present + if: | + contains(github.event.pull_request.labels.*.name, 'Performance') || + contains(github.event.pull_request.labels.*.name, 'performance') || + contains(github.event.pull_request.labels.*.name, 'benchmarks/upload') name: ${{ matrix.device }} Pytest benchmark runs-on: linux.g5.4xlarge.nvidia.gpu strategy: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e3fa6f17d4b..5a05501e1c0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,4 +1,8 @@ # This workflow builds the torchrl docs and deploys them to gh-pages. +# +# For PRs, docs are only built when the Documentation or tutorials/ label is present. +# This is auto-applied by the file-based labeler when doc files change. +# Always builds on push to main/nightly/release branches and tags. name: Generate documentation on: push: @@ -10,6 +14,7 @@ on: - v[0-9]+.[0-9]+.[0-9] - v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ pull_request: + types: [opened, synchronize, labeled] workflow_dispatch: concurrency: @@ -24,6 +29,13 @@ permissions: jobs: build-docs: + # For PRs, only build docs when Documentation or tutorials/ label is present + # Always build on push (main/nightly/release/tags) and workflow_dispatch + if: | + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' || + contains(github.event.pull_request.labels.*.name, 'Documentation') || + contains(github.event.pull_request.labels.*.name, 'tutorials/') strategy: matrix: python_version: [ "3.12" ] diff --git a/.github/workflows/test-linux-sota.yml b/.github/workflows/test-linux-sota.yml index 82c0d4f95a3..c9d23a97bb1 100644 --- a/.github/workflows/test-linux-sota.yml +++ b/.github/workflows/test-linux-sota.yml @@ -1,7 +1,13 @@ +# SOTA (State-of-the-Art) implementation tests +# +# For PRs, only runs when sota-implementations/ label is present. +# This is auto-applied by the file-based labeler when sota files change. +# Always runs on push to main/nightly/release branches. name: SOTA Tests on Linux on: pull_request: + types: [opened, synchronize, labeled] push: branches: - nightly @@ -24,6 +30,12 @@ permissions: jobs: tests: + # For PRs, only run when sota-implementations/ label is present + # Always run on push (main/nightly/release) and workflow_dispatch + if: | + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' || + contains(github.event.pull_request.labels.*.name, 'sota-implementations/') strategy: matrix: python_version: ["3.10"]