From ef9c153f20c826743b24e3f4c9bbc7b34bc38d5b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:45:18 +0200 Subject: [PATCH] Allow runing CI on external contributions (#5220) (#5288) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refs #21479: Include labeling check Signed-off-by: JesusPoderoso * Refs #21479: Keep 'Add label' job only in ubuntu workflow Signed-off-by: JesusPoderoso * Refs #21479: Apply rev suggestions Signed-off-by: eProsima --------- Signed-off-by: JesusPoderoso Signed-off-by: eProsima (cherry picked from commit 2d1e793d3afc541fe99d8449e0cdf822f6c5901f) Co-authored-by: Jesús Poderoso <120394830+JesusPoderoso@users.noreply.github.com> --- .github/workflows/reusable-mac-ci.yml | 8 -------- .github/workflows/reusable-sanitizers-ci.yml | 16 ---------------- .github/workflows/reusable-ubuntu-ci.yml | 7 ++++++- .github/workflows/reusable-windows-ci.yml | 8 -------- .github/workflows/ubuntu-ci.yml | 1 + 5 files changed, 7 insertions(+), 33 deletions(-) diff --git a/.github/workflows/reusable-mac-ci.yml b/.github/workflows/reusable-mac-ci.yml index 9c70300d6df..c7bcb5551d4 100644 --- a/.github/workflows/reusable-mac-ci.yml +++ b/.github/workflows/reusable-mac-ci.yml @@ -48,14 +48,6 @@ jobs: cmake-build-type: - 'RelWithDebInfo' steps: - - name: Add ci-pending label if PR - if: ${{ github.event_name == 'pull_request' }} - uses: eProsima/eProsima-CI/external/add_labels@v0 - with: - labels: ci-pending - number: ${{ github.event.number }} - repo: eProsima/Fast-DDS - - name: Sync eProsima/Fast-DDS repository uses: eProsima/eProsima-CI/external/checkout@v0 with: diff --git a/.github/workflows/reusable-sanitizers-ci.yml b/.github/workflows/reusable-sanitizers-ci.yml index e8dc0e66851..2c7a2d55347 100644 --- a/.github/workflows/reusable-sanitizers-ci.yml +++ b/.github/workflows/reusable-sanitizers-ci.yml @@ -55,14 +55,6 @@ jobs: if: ${{ inputs.run_asan_fastdds == true }} runs-on: ubuntu-22.04 steps: - - name: Add ci-pending label if PR - if: ${{ github.event_name == 'pull_request' }} - uses: eProsima/eProsima-CI/external/add_labels@v0 - with: - labels: ci-pending - number: ${{ github.event.number }} - repo: eProsima/Fast-DDS - - name: Sync eProsima/Fast-DDS repository uses: eProsima/eProsima-CI/external/checkout@v0 with: @@ -342,14 +334,6 @@ jobs: CC: gcc-12 CXX: g++-12 steps: - - name: Add ci-pending label if PR - if: ${{ github.event_name == 'pull_request' }} - uses: eProsima/eProsima-CI/external/add_labels@v0 - with: - labels: ci-pending - number: ${{ github.event.number }} - repo: eProsima/Fast-DDS - - name: Sync eProsima/Fast-DDS repository uses: eProsima/eProsima-CI/external/checkout@v0 with: diff --git a/.github/workflows/reusable-ubuntu-ci.yml b/.github/workflows/reusable-ubuntu-ci.yml index 3457dc90b8e..0facd420798 100644 --- a/.github/workflows/reusable-ubuntu-ci.yml +++ b/.github/workflows/reusable-ubuntu-ci.yml @@ -52,6 +52,11 @@ on: required: false type: boolean default: false + add-label: + description: 'Add the CI-PENDING label to the PR' + required: false + type: boolean + default: false env: security-cmake-flag: ${{ inputs.security == true && '-DSECURITY=ON' || '-DSECURITY=OFF' }} @@ -71,7 +76,7 @@ jobs: - 'RelWithDebInfo' steps: - name: Add ci-pending label if PR - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request' && inputs.add-label == true }} uses: eProsima/eProsima-CI/external/add_labels@v0 with: labels: ci-pending diff --git a/.github/workflows/reusable-windows-ci.yml b/.github/workflows/reusable-windows-ci.yml index 75989c99a23..afaed9b0b00 100644 --- a/.github/workflows/reusable-windows-ci.yml +++ b/.github/workflows/reusable-windows-ci.yml @@ -40,14 +40,6 @@ jobs: - 'v141' - 'v142' steps: - - name: Add ci-pending label if PR - if: ${{ github.event_name == 'pull_request' }} - uses: eProsima/eProsima-CI/external/add_labels@v0 - with: - labels: ci-pending - number: ${{ github.event.number }} - repo: eProsima/Fast-DDS - - name: Sync eProsima/Fast-DDS repository uses: eProsima/eProsima-CI/external/checkout@v0 with: diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index 040d14da85d..a55e36f64bc 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -69,3 +69,4 @@ jobs: run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} run-tests: ${{ ((inputs.run-tests == true) && true) || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'no-test')) }} use-ccache: ${{ ((inputs.use-ccache == true) && true) || false }} + add-label: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.repository) && true || false }}