Skip to content

Commit

Permalink
Only run PRs CI when run-ci label is added (#4599)
Browse files Browse the repository at this point in the history
* Refs #20648: Only run PRs CI when run-ci label is added

Signed-off-by: EduPonz <[email protected]>

* Refs #20648: Correctly add ci-pending label

Signed-off-by: EduPonz <[email protected]>

* Refs #20648: Fix documentation trigger

Signed-off-by: EduPonz <[email protected]>

* Refs #20648: Add ci-pending label in mac CI

Signed-off-by: EduPonz <[email protected]>

* Refs #20648: Set eProsima-CI version to v0 on add and remove labels actions

Signed-off-by: EduPonz <[email protected]>

* Refs #20648: Change Github workflows trigger to 'review_requested'

Signed-off-by: EduPonz <[email protected]>

---------

Signed-off-by: EduPonz <[email protected]>
(cherry picked from commit d0a334b)

# Conflicts:
#	.github/workflows/address-sanitizers.yaml
#	.github/workflows/documentation-tests.yaml
#	.github/workflows/mac-ci.yml
#	.github/workflows/thread-sanitizer.yaml
#	.github/workflows/ubuntu-ci.yml
#	.github/workflows/windows-ci.yml
  • Loading branch information
EduPonz authored and mergify[bot] committed Mar 25, 2024
1 parent 4d6539b commit 596b9f4
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 16 deletions.
37 changes: 31 additions & 6 deletions .github/workflows/address-sanitizers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ on:
default: '2.10.x'

pull_request:
<<<<<<< HEAD
branches:
- '2.10.x'
=======
types:
- review_requested
>>>>>>> d0a334b11 (Only run PRs CI when run-ci label is added (#4599))
paths-ignore:
- '**.md'
- '**.txt'
Expand All @@ -27,16 +32,26 @@ concurrency:
jobs:
asan-test:

if: ${{ !(contains(github.event.pull_request.labels.*.name, 'no-test') ||
contains(github.event.pull_request.labels.*.name, 'skip-ci') ||
contains(github.event.pull_request.labels.*.name, 'conflicts')) }}
if: ${{ (
!contains(github.event.pull_request.labels.*.name, 'skip-ci') &&
!contains(github.event.pull_request.labels.*.name, 'no-test') &&
!contains(github.event.pull_request.labels.*.name, 'conflicts')
) }}

runs-on: ubuntu-22.04

env:
FASTDDS_BRANCH: ${{ github.head_ref || github.event.inputs.fastdds_branch || '2.10.x' }}

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

# https://github.com/actions/runner-images/issues/9491
- name: Fix kernel mmap rnd bits
run: sudo sysctl vm.mmap_rnd_bits=28
Expand Down Expand Up @@ -123,9 +138,11 @@ jobs:
asan-discovery-server-test:

if: ${{ !(contains(github.event.pull_request.labels.*.name, 'no-test') ||
contains(github.event.pull_request.labels.*.name, 'skip-ci') ||
contains(github.event.pull_request.labels.*.name, 'conflicts')) }}
if: ${{ (
!contains(github.event.pull_request.labels.*.name, 'skip-ci') &&
!contains(github.event.pull_request.labels.*.name, 'no-test') &&
!contains(github.event.pull_request.labels.*.name, 'conflicts')
) }}

runs-on: ubuntu-22.04

Expand All @@ -134,6 +151,14 @@ jobs:
DEFAULT_DISCOVERY_SERVER_BRANCH: ${{ github.event.inputs.discovery_server_branch || 'v1.2.1' }}

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

# https://github.com/actions/runner-images/issues/9491
- name: Fix kernel mmap rnd bits
run: sudo sysctl vm.mmap_rnd_bits=28
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/documentation-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ on:
default: '2.10.x'

pull_request:
<<<<<<< HEAD
branches:
- '2.10.x'
=======
types:
- review_requested
>>>>>>> d0a334b11 (Only run PRs CI when run-ci label is added (#4599))
paths-ignore:
- '**.md'
- '**.txt'
Expand All @@ -26,11 +31,21 @@ env:
jobs:
ubuntu-build-and-test-documentation:
name: Documentation build and test
if: ${{ !(contains(github.event.pull_request.labels.*.name, 'skip-ci') ||
contains(github.event.pull_request.labels.*.name, 'conflicts')) }}
if: ${{ (
!contains(github.event.pull_request.labels.*.name, 'skip-ci') &&
!contains(github.event.pull_request.labels.*.name, 'conflicts')
) }}

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:
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/mac-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ on:
required: true

pull_request:
<<<<<<< HEAD
branches:
- '2.10.x'
=======
types:
- review_requested
>>>>>>> d0a334b11 (Only run PRs CI when run-ci label is added (#4599))
paths-ignore:
- '**.md'
- '**.txt'
Expand All @@ -38,9 +43,11 @@ concurrency:

jobs:
mac-ci:
if: ${{ (
!contains(github.event.pull_request.labels.*.name, 'skip-ci') &&
!contains(github.event.pull_request.labels.*.name, 'conflicts')
) }}
uses: ./.github/workflows/reusable-mac-ci.yml
if: ${{ !(contains(github.event.pull_request.labels.*.name, 'skip-ci') ||
contains(github.event.pull_request.labels.*.name, 'conflicts')) }}
with:
label: ${{ inputs.label || 'mac-ci' }}
colcon-args: ${{ inputs.colcon-args }}
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/reusable-mac-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ 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:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/reusable-ubuntu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ 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:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/reusable-windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ 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:
Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/thread-sanitizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ on:
type: string

pull_request:
<<<<<<< HEAD
branches:
- '2.10.x'
=======
types:
- review_requested
>>>>>>> d0a334b11 (Only run PRs CI when run-ci label is added (#4599))
paths-ignore:
- '**.md'
- '**.txt'
Expand All @@ -32,9 +37,11 @@ jobs:
ubuntu-sanitizer-run:
name: Sanitizer Evaluation

if: ${{ !(contains(github.event.pull_request.labels.*.name, 'no-test') ||
contains(github.event.pull_request.labels.*.name, 'skip-ci') ||
contains(github.event.pull_request.labels.*.name, 'conflicts')) }}
if: ${{ (
!contains(github.event.pull_request.labels.*.name, 'skip-ci') &&
!contains(github.event.pull_request.labels.*.name, 'no-test') &&
!contains(github.event.pull_request.labels.*.name, 'conflicts')
) }}

runs-on: ubuntu-22.04

Expand All @@ -47,6 +54,14 @@ jobs:
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

# https://github.com/actions/runner-images/issues/9491
- name: Fix kernel mmap rnd bits
run: sudo sysctl vm.mmap_rnd_bits=28
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/ubuntu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,19 @@ on:
type: string
required: true

<<<<<<< HEAD
=======
pull_request:
types:
- review_requested
paths-ignore:
- '**.md'
- '**.txt'
- '!**/CMakeLists.txt'

>>>>>>> d0a334b11 (Only run PRs CI when run-ci label is added (#4599))
concurrency:
group: ${{ github.workflow }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -37,6 +48,10 @@ jobs:
os-image:
- 'ubuntu-22.04'

if: ${{ (
!contains(github.event.pull_request.labels.*.name, 'skip-ci') &&
!contains(github.event.pull_request.labels.*.name, 'conflicts')
) }}
uses: ./.github/workflows/reusable-ubuntu-ci.yml
with:
os-image: ${{ matrix.os-image }}
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ on:
required: true

pull_request:
<<<<<<< HEAD
branches:
- '2.10.x'
=======
types:
- review_requested
>>>>>>> d0a334b11 (Only run PRs CI when run-ci label is added (#4599))
paths-ignore:
- '**.md'
- '**.txt'
Expand All @@ -38,9 +43,11 @@ concurrency:

jobs:
windows-ci:
if: ${{ (
!contains(github.event.pull_request.labels.*.name, 'skip-ci') &&
!contains(github.event.pull_request.labels.*.name, 'conflicts')
) }}
uses: ./.github/workflows/reusable-windows-ci.yml
if: ${{ !(contains(github.event.pull_request.labels.*.name, 'skip-ci') ||
contains(github.event.pull_request.labels.*.name, 'conflicts')) }}
with:
label: ${{ inputs.label || 'windows-ci' }}
colcon-args: ${{ inputs.colcon-args }}
Expand Down

0 comments on commit 596b9f4

Please sign in to comment.