Skip to content

Commit a6c31c0

Browse files
Make skip-ci label report required statuses as pass (#323)
* Refs #25442. Make `skip-ci` label report required statuses as pass. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #25442. Fix condition in Archive Test Results. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #25442. Fix condition for add-label. Also improve readability. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
1 parent ad49aee commit a6c31c0

4 files changed

Lines changed: 25 additions & 10 deletions

File tree

.github/workflows/mac-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ jobs:
5656
ctest-args: ${{ inputs.ctest-args }}
5757
fastcdr-branch: ${{ inputs.fastcdr-branch || github.ref }}
5858
run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
59-
run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }}
59+
run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test')) && (!contains(github.event.pull_request.labels.*.name, 'skip-ci'))) }}

.github/workflows/reusable-ci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ defaults:
6262
jobs:
6363
fastcdr_test:
6464
runs-on: ${{ inputs.os-version }}
65-
if: ${{ inputs.run-build == true }}
6665
strategy:
6766
fail-fast: false
6867
matrix:
@@ -82,44 +81,51 @@ jobs:
8281
repo: eProsima/Fast-CDR
8382

8483
- name: Sync eProsima/Fast-CDR repository
84+
if: ${{ inputs.run-build == true }}
8585
uses: eProsima/eProsima-CI/external/checkout@v0
8686
with:
8787
path: src/fastcdr
8888
ref: ${{ inputs.fastcdr-branch }}
8989

9090
- name: Install Fix Python version
91+
if: ${{ inputs.run-build == true }}
9192
uses: eProsima/eProsima-CI/external/setup-python@v0
9293
with:
9394
python-version: '3.11'
9495

9596
- name: Get minimum supported version of CMake
97+
if: ${{ inputs.run-build == true }}
9698
uses: eProsima/eProsima-CI/external/get-cmake@v0
9799
with:
98100
cmakeVersion: '3.22.6'
99101

100102
- name: Install Colcon dependencies
103+
if: ${{ inputs.run-build == true }}
101104
uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0
102105

103106
- name: Setup CCache
107+
if: ${{ inputs.run-build == true && inputs.use-ccache == true }}
104108
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0
105-
if: ${{ inputs.use-ccache == true }}
106109
with:
107110
api_token: ${{ secrets.GITHUB_TOKEN }}
108111

109112
- name: Install Python dependencies
113+
if: ${{ inputs.run-build == true }}
110114
uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
111115
with:
112116
packages: vcstool
113117
upgrade: false
114118

115119
- name: Fetch Fast DDS CI dependencies
120+
if: ${{ inputs.run-build == true }}
116121
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
117122
with:
118123
vcs_repos_file: ${{ github.workspace }}/src/fastcdr/.github/workflows/config/test.repos
119124
destination_workspace: src
120125
skip_existing: 'true'
121126

122127
- name: Colcon build
128+
if: ${{ inputs.run-build == true }}
123129
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
124130
with:
125131
colcon_meta_file: ${{ github.workspace }}/src/fastcdr/.github/workflows/config/build.meta
@@ -132,7 +138,7 @@ jobs:
132138

133139
- name: Colcon test
134140
id: test_fastcdr
135-
if: ${{ inputs.run-tests == true }}
141+
if: ${{ inputs.run-build == true && inputs.run-tests == true }}
136142
uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0
137143
with:
138144
colcon_meta_file: ${{ github.workspace }}/src/fastcdr/.github/workflows/config/build.meta ${{ github.workspace }}/src/fastcdr/.github/workflows/config/test.meta
@@ -144,7 +150,7 @@ jobs:
144150

145151
- name: Fast CDR Test summary
146152
uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0
147-
if: ${{ !cancelled() && inputs.run-tests == true }}
153+
if: ${{ !cancelled() && inputs.run-build == true && inputs.run-tests == true }}
148154
with:
149155
junit_reports_dir: ${{ steps.test_fastcdr.outputs.ctest_results_path }}
150156
print_summary: 'True'
@@ -153,7 +159,7 @@ jobs:
153159
show_skipped: 'False'
154160

155161
- name: Archive Test Results
156-
if: always()
162+
if: ${{ !cancelled() && inputs.run-build == true && inputs.run-tests == true }}
157163
uses: eProsima/eProsima-CI/external/upload-artifact@v0
158164
with:
159165
name: test-results-${{ inputs.label }}${{ matrix.strict-bool == true && '-strict-bool' || '' }}

.github/workflows/ubuntu-ci.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,16 @@ jobs:
6060
cmake-args: ${{ inputs.cmake-args }}
6161
ctest-args: ${{ inputs.ctest-args }}
6262
fastcdr-branch: ${{ inputs.fastcdr-branch || github.ref }}
63-
run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
64-
run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }}
63+
run-build: ${{ !(github.event_name == 'pull_request') ||
64+
!contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
65+
run-tests: ${{ (inputs.run-tests == true) ||
66+
(
67+
(github.event_name == 'pull_request') &&
68+
(!contains(github.event.pull_request.labels.*.name, 'no-test')) &&
69+
(!contains(github.event.pull_request.labels.*.name, 'skip-ci'))
70+
) }}
6571
use-ccache: ${{ inputs.use-ccache || false }}
66-
add-label: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.repository) && true || false }}
72+
add-label: ${{ (github.event_name == 'pull_request') &&
73+
(github.event.pull_request.head.repo.full_name == github.repository) &&
74+
(!contains(github.event.pull_request.labels.*.name, 'skip-ci')) &&
75+
true || false }}

.github/workflows/windows-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ jobs:
6868
ctest-args: ${{ inputs.ctest-args }}
6969
fastcdr-branch: ${{ inputs.fastcdr-branch || github.ref }}
7070
run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
71-
run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }}
71+
run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test')) && (!contains(github.event.pull_request.labels.*.name, 'skip-ci'))) }}

0 commit comments

Comments
 (0)