From 4968d0b34ffd624445de0137924288bccf28f51a Mon Sep 17 00:00:00 2001 From: Jane Xu Date: Thu, 2 Sep 2021 16:21:52 -0700 Subject: [PATCH] [POC] .github: Add event name to concurrency (#64402) Summary: This would ensure that manually/API triggered workflows would not cancel other triggered workflows. For example, the manually triggered periodic 11.1 linux job cancelled the scheduled one here, which we may not want: ![image](https://user-images.githubusercontent.com/31798555/131752175-1c99d56e-d344-46e1-b8ac-9c12bba0569a.png). This would be helpful later as we use more dispatched workflows (e.g., for bisect functionality) Pull Request resolved: https://github.com/pytorch/pytorch/pull/64402 Reviewed By: malfet Differential Revision: D30734860 Pulled By: janeyx99 fbshipit-source-id: 220016716094666e9af836fcd716dd529cf23d8a --- .github/scripts/ensure_actions_will_cancel.py | 3 ++- .github/templates/linux_ci_workflow.yml.j2 | 6 +++++- .github/templates/windows_ci_workflow.yml.j2 | 2 +- .github/workflows/add_annotations.yml | 2 +- .github/workflows/auto_label.yml | 2 +- .github/workflows/build_linux_conda.yml | 2 +- .github/workflows/build_linux_libtorch.yml | 2 +- .github/workflows/build_linux_wheels.yml | 2 +- .github/workflows/create_release.yml | 2 +- .../generated-libtorch-linux-xenial-cuda10.2-py3.6-gcc7.yml | 6 +++++- .../generated-libtorch-linux-xenial-cuda11.3-py3.6-gcc7.yml | 6 +++++- .github/workflows/generated-linux-bionic-cuda10.2-py3.9-gcc7.yml | 6 +++++- .github/workflows/generated-linux-bionic-py3.8-gcc9-coverage.yml | 6 +++++- .github/workflows/generated-linux-xenial-cuda10.2-py3.6-gcc7.yml | 6 +++++- .github/workflows/generated-linux-xenial-cuda11.3-py3.6-gcc7.yml | 6 +++++- .github/workflows/generated-linux-xenial-py3.6-gcc5.4.yml | 6 +++++- .github/workflows/generated-linux-xenial-py3.6-gcc7-bazel-test.yml | 6 +++++- ...generated-periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7.yml | 6 +++++- .../generated-periodic-linux-xenial-cuda11.1-py3.6-gcc7.yml | 6 +++++- .github/workflows/generated-periodic-win-vs2019-cuda11.1-py3.yml | 2 +- .github/workflows/generated-win-vs2019-cpu-py3.yml | 2 +- .github/workflows/generated-win-vs2019-cuda10.1-py3.yml | 2 +- .github/workflows/generated-win-vs2019-cuda11.3-py3.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/run_torchbench.yml | 2 +- .github/workflows/test_tools.yml | 2 +- 26 files changed, 71 insertions(+), 26 deletions(-) diff --git a/.github/scripts/ensure_actions_will_cancel.py b/.github/scripts/ensure_actions_will_cancel.py index 18e61d2..8af3e80 100755 --- a/.github/scripts/ensure_actions_will_cancel.py +++ b/.github/scripts/ensure_actions_will_cancel.py @@ -15,7 +15,8 @@ def concurrency_key(filename: Path) -> str: workflow_name = filename.with_suffix("").name.replace("_", "-") if workflow_name.startswith("generated-"): workflow_name = workflow_name[len("generated-"):] - return f"{workflow_name}-${{{{ github.event.pull_request.number || github.sha }}}}" + return f"{workflow_name}-${{{{ github.event.pull_request.number || github.sha }}}}" \ + "-${{ github.event_name == 'workflow_dispatch' }}" def should_check(filename: Path) -> bool: diff --git a/.github/templates/linux_ci_workflow.yml.j2 b/.github/templates/linux_ci_workflow.yml.j2 index 314122b..2d85670 100644 --- a/.github/templates/linux_ci_workflow.yml.j2 +++ b/.github/templates/linux_ci_workflow.yml.j2 @@ -46,7 +46,7 @@ env: PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} concurrency: - group: !{{ build_environment }}-${{ github.event.pull_request.number || github.sha }} + group: !{{ build_environment }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: @@ -54,9 +54,13 @@ jobs: !{{ ciflow_config.root_job_name }}: runs-on: ubuntu-18.04 if: ${{ !{{ ciflow_config.root_job_condition }} }} + env: + LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} steps: - name: noop run: echo running !{{ ciflow_config.root_job_name }} + - name: print labels + run: echo "${LABELS}" {%- endif %} calculate-docker-image: if: ${{ github.repository_owner == 'pytorch' }} diff --git a/.github/templates/windows_ci_workflow.yml.j2 b/.github/templates/windows_ci_workflow.yml.j2 index 05d739d..4f486dd 100644 --- a/.github/templates/windows_ci_workflow.yml.j2 +++ b/.github/templates/windows_ci_workflow.yml.j2 @@ -61,7 +61,7 @@ env: {%- endif %} concurrency: - group: !{{ build_environment }}-${{ github.event.pull_request.number || github.sha }} + group: !{{ build_environment }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: diff --git a/.github/workflows/add_annotations.yml b/.github/workflows/add_annotations.yml index 9bb3c1b..76f7307 100644 --- a/.github/workflows/add_annotations.yml +++ b/.github/workflows/add_annotations.yml @@ -9,7 +9,7 @@ on: concurrency: - group: add-annotations-${{ github.event.pull_request.number || github.sha }} + group: add-annotations-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true diff --git a/.github/workflows/auto_label.yml b/.github/workflows/auto_label.yml index 1616ea9..6dcb29a 100644 --- a/.github/workflows/auto_label.yml +++ b/.github/workflows/auto_label.yml @@ -8,7 +8,7 @@ on: concurrency: - group: auto-label-${{ github.event.pull_request.number || github.sha }} + group: auto-label-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true diff --git a/.github/workflows/build_linux_conda.yml b/.github/workflows/build_linux_conda.yml index 536a187..b43c201 100644 --- a/.github/workflows/build_linux_conda.yml +++ b/.github/workflows/build_linux_conda.yml @@ -111,5 +111,5 @@ jobs: python3 -m tools.stats.upload_binary_size_to_scuba || exit 0 concurrency: - group: build-linux-conda-${{ github.event.pull_request.number || github.sha }} + group: build-linux-conda-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true diff --git a/.github/workflows/build_linux_libtorch.yml b/.github/workflows/build_linux_libtorch.yml index 9321c6a..0a1c653 100644 --- a/.github/workflows/build_linux_libtorch.yml +++ b/.github/workflows/build_linux_libtorch.yml @@ -110,5 +110,5 @@ jobs: python3 -m tools.stats.upload_binary_size_to_scuba || exit 0 concurrency: - group: build-linux-libtorch-${{ github.event.pull_request.number || github.sha }} + group: build-linux-libtorch-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true diff --git a/.github/workflows/build_linux_wheels.yml b/.github/workflows/build_linux_wheels.yml index 15a38f6..1f8e5f0 100644 --- a/.github/workflows/build_linux_wheels.yml +++ b/.github/workflows/build_linux_wheels.yml @@ -109,5 +109,5 @@ jobs: python3 -m tools.stats.upload_binary_size_to_scuba || exit 0 concurrency: - group: build-linux-wheels-${{ github.event.pull_request.number || github.sha }} + group: build-linux-wheels-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 4cd0568..eea423c 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -48,5 +48,5 @@ jobs: files: ${{env.PT_RELEASE_FILE}} concurrency: - group: create-release-${{ github.event.pull_request.number || github.sha }} + group: create-release-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true diff --git a/.github/workflows/generated-libtorch-linux-xenial-cuda10.2-py3.6-gcc7.yml b/.github/workflows/generated-libtorch-linux-xenial-cuda10.2-py3.6-gcc7.yml index d211189..477fe1b 100644 --- a/.github/workflows/generated-libtorch-linux-xenial-cuda10.2-py3.6-gcc7.yml +++ b/.github/workflows/generated-libtorch-linux-xenial-cuda10.2-py3.6-gcc7.yml @@ -27,16 +27,20 @@ env: PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} concurrency: - group: libtorch-linux-xenial-cuda10.2-py3.6-gcc7-${{ github.event.pull_request.number || github.sha }} + group: libtorch-linux-xenial-cuda10.2-py3.6-gcc7-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: ciflow_should_run: runs-on: ubuntu-18.04 if: ${{ (github.event_name != 'pull_request') || (github.event.action !='unassigned') || (contains(github.event.pull_request.labels.*.name, 'ciflow/all') || contains(github.event.pull_request.labels.*.name, 'ciflow/cuda') || contains(github.event.pull_request.labels.*.name, 'ciflow/libtorch') || contains(github.event.pull_request.labels.*.name, 'ciflow/linux')) }} + env: + LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} steps: - name: noop run: echo running ciflow_should_run + - name: print labels + run: echo "${LABELS}" calculate-docker-image: if: ${{ github.repository_owner == 'pytorch' }} runs-on: linux.2xlarge diff --git a/.github/workflows/generated-libtorch-linux-xenial-cuda11.3-py3.6-gcc7.yml b/.github/workflows/generated-libtorch-linux-xenial-cuda11.3-py3.6-gcc7.yml index 51811ae..9fd6d7f 100644 --- a/.github/workflows/generated-libtorch-linux-xenial-cuda11.3-py3.6-gcc7.yml +++ b/.github/workflows/generated-libtorch-linux-xenial-cuda11.3-py3.6-gcc7.yml @@ -27,16 +27,20 @@ env: PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} concurrency: - group: libtorch-linux-xenial-cuda11.3-py3.6-gcc7-${{ github.event.pull_request.number || github.sha }} + group: libtorch-linux-xenial-cuda11.3-py3.6-gcc7-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: ciflow_should_run: runs-on: ubuntu-18.04 if: ${{ (github.event_name != 'pull_request') || (github.event.action !='unassigned') || (contains(github.event.pull_request.labels.*.name, 'ciflow/all') || contains(github.event.pull_request.labels.*.name, 'ciflow/cuda') || contains(github.event.pull_request.labels.*.name, 'ciflow/libtorch') || contains(github.event.pull_request.labels.*.name, 'ciflow/linux')) }} + env: + LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} steps: - name: noop run: echo running ciflow_should_run + - name: print labels + run: echo "${LABELS}" calculate-docker-image: if: ${{ github.repository_owner == 'pytorch' }} runs-on: linux.2xlarge diff --git a/.github/workflows/generated-linux-bionic-cuda10.2-py3.9-gcc7.yml b/.github/workflows/generated-linux-bionic-cuda10.2-py3.9-gcc7.yml index f410f1f..ee0ca4c 100644 --- a/.github/workflows/generated-linux-bionic-cuda10.2-py3.9-gcc7.yml +++ b/.github/workflows/generated-linux-bionic-cuda10.2-py3.9-gcc7.yml @@ -27,16 +27,20 @@ env: PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} concurrency: - group: linux-bionic-cuda10.2-py3.9-gcc7-${{ github.event.pull_request.number || github.sha }} + group: linux-bionic-cuda10.2-py3.9-gcc7-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: ciflow_should_run: runs-on: ubuntu-18.04 if: ${{ (github.event_name != 'pull_request') || (github.event.action !='unassigned') || (contains(github.event.pull_request.labels.*.name, 'ciflow/all') || contains(github.event.pull_request.labels.*.name, 'ciflow/cuda') || contains(github.event.pull_request.labels.*.name, 'ciflow/linux') || contains(github.event.pull_request.labels.*.name, 'ciflow/slow')) }} + env: + LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} steps: - name: noop run: echo running ciflow_should_run + - name: print labels + run: echo "${LABELS}" calculate-docker-image: if: ${{ github.repository_owner == 'pytorch' }} runs-on: linux.2xlarge diff --git a/.github/workflows/generated-linux-bionic-py3.8-gcc9-coverage.yml b/.github/workflows/generated-linux-bionic-py3.8-gcc9-coverage.yml index 2bcb426..2103f2b 100644 --- a/.github/workflows/generated-linux-bionic-py3.8-gcc9-coverage.yml +++ b/.github/workflows/generated-linux-bionic-py3.8-gcc9-coverage.yml @@ -27,16 +27,20 @@ env: PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} concurrency: - group: linux-bionic-py3.8-gcc9-coverage-${{ github.event.pull_request.number || github.sha }} + group: linux-bionic-py3.8-gcc9-coverage-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: ciflow_should_run: runs-on: ubuntu-18.04 if: ${{ (github.event_name != 'pull_request') || (github.event.action !='unassigned') || (contains(github.event.pull_request.labels.*.name, 'ciflow/all') || contains(github.event.pull_request.labels.*.name, 'ciflow/coverage') || contains(github.event.pull_request.labels.*.name, 'ciflow/cpu') || contains(github.event.pull_request.labels.*.name, 'ciflow/default') || contains(github.event.pull_request.labels.*.name, 'ciflow/linux')) }} + env: + LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} steps: - name: noop run: echo running ciflow_should_run + - name: print labels + run: echo "${LABELS}" calculate-docker-image: if: ${{ github.repository_owner == 'pytorch' }} runs-on: linux.2xlarge diff --git a/.github/workflows/generated-linux-xenial-cuda10.2-py3.6-gcc7.yml b/.github/workflows/generated-linux-xenial-cuda10.2-py3.6-gcc7.yml index 656b5654..187f9c1 100644 --- a/.github/workflows/generated-linux-xenial-cuda10.2-py3.6-gcc7.yml +++ b/.github/workflows/generated-linux-xenial-cuda10.2-py3.6-gcc7.yml @@ -27,16 +27,20 @@ env: PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} concurrency: - group: linux-xenial-cuda10.2-py3.6-gcc7-${{ github.event.pull_request.number || github.sha }} + group: linux-xenial-cuda10.2-py3.6-gcc7-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: ciflow_should_run: runs-on: ubuntu-18.04 if: ${{ (github.event_name != 'pull_request') || (github.event.action !='unassigned') || (contains(github.event.pull_request.labels.*.name, 'ciflow/all') || contains(github.event.pull_request.labels.*.name, 'ciflow/cuda') || contains(github.event.pull_request.labels.*.name, 'ciflow/linux') || contains(github.event.pull_request.labels.*.name, 'ciflow/slow')) }} + env: + LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} steps: - name: noop run: echo running ciflow_should_run + - name: print labels + run: echo "${LABELS}" calculate-docker-image: if: ${{ github.repository_owner == 'pytorch' }} runs-on: linux.2xlarge diff --git a/.github/workflows/generated-linux-xenial-cuda11.3-py3.6-gcc7.yml b/.github/workflows/generated-linux-xenial-cuda11.3-py3.6-gcc7.yml index 68b4285..9fff700 100644 --- a/.github/workflows/generated-linux-xenial-cuda11.3-py3.6-gcc7.yml +++ b/.github/workflows/generated-linux-xenial-cuda11.3-py3.6-gcc7.yml @@ -27,16 +27,20 @@ env: PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} concurrency: - group: linux-xenial-cuda11.3-py3.6-gcc7-${{ github.event.pull_request.number || github.sha }} + group: linux-xenial-cuda11.3-py3.6-gcc7-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: ciflow_should_run: runs-on: ubuntu-18.04 if: ${{ (github.event_name != 'pull_request') || (github.event.action !='unassigned') || (contains(github.event.pull_request.labels.*.name, 'ciflow/all') || contains(github.event.pull_request.labels.*.name, 'ciflow/cuda') || contains(github.event.pull_request.labels.*.name, 'ciflow/default') || contains(github.event.pull_request.labels.*.name, 'ciflow/linux')) }} + env: + LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} steps: - name: noop run: echo running ciflow_should_run + - name: print labels + run: echo "${LABELS}" calculate-docker-image: if: ${{ github.repository_owner == 'pytorch' }} runs-on: linux.2xlarge diff --git a/.github/workflows/generated-linux-xenial-py3.6-gcc5.4.yml b/.github/workflows/generated-linux-xenial-py3.6-gcc5.4.yml index b347b52..d1187de 100644 --- a/.github/workflows/generated-linux-xenial-py3.6-gcc5.4.yml +++ b/.github/workflows/generated-linux-xenial-py3.6-gcc5.4.yml @@ -27,16 +27,20 @@ env: PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} concurrency: - group: linux-xenial-py3.6-gcc5.4-${{ github.event.pull_request.number || github.sha }} + group: linux-xenial-py3.6-gcc5.4-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: ciflow_should_run: runs-on: ubuntu-18.04 if: ${{ (github.event_name != 'pull_request') || (github.event.action !='unassigned') || (contains(github.event.pull_request.labels.*.name, 'ciflow/all') || contains(github.event.pull_request.labels.*.name, 'ciflow/cpu') || contains(github.event.pull_request.labels.*.name, 'ciflow/default') || contains(github.event.pull_request.labels.*.name, 'ciflow/linux')) }} + env: + LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} steps: - name: noop run: echo running ciflow_should_run + - name: print labels + run: echo "${LABELS}" calculate-docker-image: if: ${{ github.repository_owner == 'pytorch' }} runs-on: linux.2xlarge diff --git a/.github/workflows/generated-linux-xenial-py3.6-gcc7-bazel-test.yml b/.github/workflows/generated-linux-xenial-py3.6-gcc7-bazel-test.yml index e86cc56..49d2cd2 100644 --- a/.github/workflows/generated-linux-xenial-py3.6-gcc7-bazel-test.yml +++ b/.github/workflows/generated-linux-xenial-py3.6-gcc7-bazel-test.yml @@ -27,16 +27,20 @@ env: PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} concurrency: - group: linux-xenial-py3.6-gcc7-bazel-test-${{ github.event.pull_request.number || github.sha }} + group: linux-xenial-py3.6-gcc7-bazel-test-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: ciflow_should_run: runs-on: ubuntu-18.04 if: ${{ (github.event_name != 'pull_request') || (github.event.action !='unassigned') || (contains(github.event.pull_request.labels.*.name, 'ciflow/all') || contains(github.event.pull_request.labels.*.name, 'ciflow/bazel') || contains(github.event.pull_request.labels.*.name, 'ciflow/cpu') || contains(github.event.pull_request.labels.*.name, 'ciflow/default') || contains(github.event.pull_request.labels.*.name, 'ciflow/linux')) }} + env: + LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} steps: - name: noop run: echo running ciflow_should_run + - name: print labels + run: echo "${LABELS}" calculate-docker-image: if: ${{ github.repository_owner == 'pytorch' }} runs-on: linux.2xlarge diff --git a/.github/workflows/generated-periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7.yml b/.github/workflows/generated-periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7.yml index b591519..620e4c3 100644 --- a/.github/workflows/generated-periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7.yml +++ b/.github/workflows/generated-periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7.yml @@ -25,16 +25,20 @@ env: PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} concurrency: - group: periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7-${{ github.event.pull_request.number || github.sha }} + group: periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: ciflow_should_run: runs-on: ubuntu-18.04 if: ${{ (github.event_name != 'pull_request') || (github.event.action !='unassigned') || (contains(github.event.pull_request.labels.*.name, 'ciflow/all') || contains(github.event.pull_request.labels.*.name, 'ciflow/cuda') || contains(github.event.pull_request.labels.*.name, 'ciflow/libtorch') || contains(github.event.pull_request.labels.*.name, 'ciflow/linux') || contains(github.event.pull_request.labels.*.name, 'ciflow/scheduled')) }} + env: + LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} steps: - name: noop run: echo running ciflow_should_run + - name: print labels + run: echo "${LABELS}" calculate-docker-image: if: ${{ github.repository_owner == 'pytorch' }} runs-on: linux.2xlarge diff --git a/.github/workflows/generated-periodic-linux-xenial-cuda11.1-py3.6-gcc7.yml b/.github/workflows/generated-periodic-linux-xenial-cuda11.1-py3.6-gcc7.yml index 07593ad..e318e66 100644 --- a/.github/workflows/generated-periodic-linux-xenial-cuda11.1-py3.6-gcc7.yml +++ b/.github/workflows/generated-periodic-linux-xenial-cuda11.1-py3.6-gcc7.yml @@ -25,16 +25,20 @@ env: PR_LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} concurrency: - group: periodic-linux-xenial-cuda11.1-py3.6-gcc7-${{ github.event.pull_request.number || github.sha }} + group: periodic-linux-xenial-cuda11.1-py3.6-gcc7-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: ciflow_should_run: runs-on: ubuntu-18.04 if: ${{ (github.event_name != 'pull_request') || (github.event.action !='unassigned') || (contains(github.event.pull_request.labels.*.name, 'ciflow/all') || contains(github.event.pull_request.labels.*.name, 'ciflow/cuda') || contains(github.event.pull_request.labels.*.name, 'ciflow/linux') || contains(github.event.pull_request.labels.*.name, 'ciflow/scheduled')) }} + env: + LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }} steps: - name: noop run: echo running ciflow_should_run + - name: print labels + run: echo "${LABELS}" calculate-docker-image: if: ${{ github.repository_owner == 'pytorch' }} runs-on: linux.2xlarge diff --git a/.github/workflows/generated-periodic-win-vs2019-cuda11.1-py3.yml b/.github/workflows/generated-periodic-win-vs2019-cuda11.1-py3.yml index 61c63f4..360fdc3 100644 --- a/.github/workflows/generated-periodic-win-vs2019-cuda11.1-py3.yml +++ b/.github/workflows/generated-periodic-win-vs2019-cuda11.1-py3.yml @@ -29,7 +29,7 @@ env: USE_CUDA: 1 concurrency: - group: periodic-win-vs2019-cuda11.1-py3-${{ github.event.pull_request.number || github.sha }} + group: periodic-win-vs2019-cuda11.1-py3-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: diff --git a/.github/workflows/generated-win-vs2019-cpu-py3.yml b/.github/workflows/generated-win-vs2019-cpu-py3.yml index 6ef8e85..1277a69 100644 --- a/.github/workflows/generated-win-vs2019-cpu-py3.yml +++ b/.github/workflows/generated-win-vs2019-cpu-py3.yml @@ -29,7 +29,7 @@ env: no_proxy: localhost,127.0.0.1,amazonaws.com,s3.amazonaws.com,169.254.169.254,169.254.170.2,/var/run/docker.sock concurrency: - group: win-vs2019-cpu-py3-${{ github.event.pull_request.number || github.sha }} + group: win-vs2019-cpu-py3-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: diff --git a/.github/workflows/generated-win-vs2019-cuda10.1-py3.yml b/.github/workflows/generated-win-vs2019-cuda10.1-py3.yml index c158f08..185cb59 100644 --- a/.github/workflows/generated-win-vs2019-cuda10.1-py3.yml +++ b/.github/workflows/generated-win-vs2019-cuda10.1-py3.yml @@ -31,7 +31,7 @@ env: USE_CUDA: 1 concurrency: - group: win-vs2019-cuda10.1-py3-${{ github.event.pull_request.number || github.sha }} + group: win-vs2019-cuda10.1-py3-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: diff --git a/.github/workflows/generated-win-vs2019-cuda11.3-py3.yml b/.github/workflows/generated-win-vs2019-cuda11.3-py3.yml index bd945c3..b339e79 100644 --- a/.github/workflows/generated-win-vs2019-cuda11.3-py3.yml +++ b/.github/workflows/generated-win-vs2019-cuda11.3-py3.yml @@ -31,7 +31,7 @@ env: USE_CUDA: 1 concurrency: - group: win-vs2019-cuda11.3-py3-${{ github.event.pull_request.number || github.sha }} + group: win-vs2019-cuda11.3-py3-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true jobs: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f69d2b0..a1b6182 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -467,5 +467,5 @@ jobs: fi concurrency: - group: lint-${{ github.event.pull_request.number || github.sha }} + group: lint-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true diff --git a/.github/workflows/run_torchbench.yml b/.github/workflows/run_torchbench.yml index 786d25f..cee27e1 100644 --- a/.github/workflows/run_torchbench.yml +++ b/.github/workflows/run_torchbench.yml @@ -66,5 +66,5 @@ jobs: path: ~/.torchbench/bisection/pr${{ github.event.number }} concurrency: - group: run-torchbench-${{ github.event.pull_request.number || github.sha }} + group: run-torchbench-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true diff --git a/.github/workflows/test_tools.yml b/.github/workflows/test_tools.yml index afc790b..02ae0dd 100644 --- a/.github/workflows/test_tools.yml +++ b/.github/workflows/test_tools.yml @@ -31,5 +31,5 @@ jobs: run: python -m unittest discover -vs tools/test -p 'test_*.py' concurrency: - group: test-tools-${{ github.event.pull_request.number || github.sha }} + group: test-tools-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} cancel-in-progress: true -- 2.7.4