Skip to content

Commit 8401ff7

Browse files
committed
Merge branch 'release/3.9.0'
* gh/release/3.9.0: Version 3.9.0 Add downstream ci (#72) Fix ecbuild_disable_unused_feature Add workflow to check release version is correct (#54) Add ecbuild_override_compiler_flags macro Add utility to initialise overrideable compiler flags Add utility to purge compiler flags for a given language Add tests according to Github issue #65 Enable distinction between enabled/disabled features Update ci action to v2 (#68) Stricter match condition for _fail strings (#64) CPP out LOC calls for NAG.
2 parents a07c0a5 + 617eb67 commit 8401ff7

23 files changed

+485
-72
lines changed

.github/ci-config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dependency_branch: develop
2+
parallelism_factor: 8

.github/ci-hpc-config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build:
2+
modules:
3+
- ninja
4+
parallel: 64
5+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Check VERSION file
2+
3+
on:
4+
push:
5+
branches:
6+
- "release/**"
7+
- "hotfix/**"
8+
9+
jobs:
10+
check_version:
11+
uses: ecmwf-actions/reusable-workflows/.github/workflows/check-release-version.yml@v2

.github/workflows/ci-single.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: ci-single
2+
3+
# Controls when the workflow will run
4+
on:
5+
6+
# Trigger the workflow on all pushes, except on tag creation
7+
push:
8+
branches:
9+
- '**'
10+
tags-ignore:
11+
- '**'
12+
13+
# Trigger the workflow on all pull requests
14+
pull_request: ~
15+
16+
# Allow workflow to be dispatched on demand
17+
workflow_dispatch: ~
18+
19+
jobs:
20+
21+
# Calls a reusable CI workflow to build & test the current repository.
22+
# We skip jobs that will result in duplicate artifacts, since the code does not depend on the compiler.
23+
ci:
24+
name: ci
25+
uses: ecmwf-actions/reusable-workflows/.github/workflows/ci.yml@v2
26+
with:
27+
skip_matrix_jobs: |
28+

.github/workflows/ci.yml

+83-16
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,97 @@
11
name: ci
22

3-
# Controls when the workflow will run
43
on:
5-
6-
# Trigger the workflow on all pushes, except on tag creation
4+
# Trigger the workflow on push to master or develop, except tag creation
75
push:
86
branches:
9-
- '**'
7+
- "master"
8+
- "develop"
109
tags-ignore:
11-
- '**'
10+
- "**"
11+
paths-ignore:
12+
- "docs/**"
13+
- "bamboo/**"
14+
- "README.rst"
1215

13-
# Trigger the workflow on all pull requests
16+
# Trigger the workflow on pull request
1417
pull_request: ~
1518

16-
# Allow workflow to be dispatched on demand
19+
# Trigger the workflow manually
1720
workflow_dispatch: ~
1821

22+
# Trigger after public PR approved for CI
23+
pull_request_target:
24+
types: [labeled]
25+
26+
1927
jobs:
28+
# Run CI including downstream packages on self-hosted runners
29+
downstream-ci:
30+
name: downstream-ci
31+
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
32+
uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci.yml@main
33+
with:
34+
ecbuild: ecmwf/ecbuild@${{ github.event.pull_request.head.sha || github.sha }}
35+
codecov_upload: false
36+
secrets: inherit
2037

21-
# Calls a reusable CI workflow to build & test the current repository.
22-
# We skip jobs that will result in duplicate artifacts, since the code does not depend on the compiler.
23-
ci:
24-
name: ci
25-
uses: ecmwf-actions/reusable-workflows/.github/workflows/ci.yml@v1
38+
# Run CI of private downstream packages on self-hosted runners
39+
private-downstream-ci:
40+
name: private-downstream-ci
41+
needs: [downstream-ci]
42+
if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
43+
runs-on: ubuntu-latest
44+
permissions:
45+
pull-requests: write
46+
steps:
47+
- name: Dispatch private downstream CI
48+
uses: ecmwf-actions/dispatch-private-downstream-ci@v1
49+
with:
50+
token: ${{ secrets.GH_REPO_READ_TOKEN }}
51+
owner: ecmwf-actions
52+
repository: private-downstream-ci
53+
event_type: downstream-ci
54+
payload: '{"ecbuild": "ecmwf/ecbuild@${{ github.event.pull_request.head.sha || github.sha }}"}'
55+
56+
# Build downstream packages on HPC
57+
downstream-ci-hpc:
58+
name: downstream-ci-hpc
59+
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
60+
uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main
2661
with:
27-
skip_matrix_jobs: |
28-
29-
30-
62+
ecbuild: ecmwf/ecbuild@${{ github.event.pull_request.head.sha || github.sha }}
63+
secrets: inherit
64+
65+
# Run CI of private downstream packages on HPC
66+
private-downstream-ci-hpc:
67+
name: private-downstream-ci-hpc
68+
needs: [downstream-ci-hpc]
69+
if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
70+
runs-on: ubuntu-latest
71+
permissions:
72+
pull-requests: write
73+
steps:
74+
- name: Dispatch private downstream CI
75+
uses: ecmwf-actions/dispatch-private-downstream-ci@v1
76+
with:
77+
token: ${{ secrets.GH_REPO_READ_TOKEN }}
78+
owner: ecmwf-actions
79+
repository: private-downstream-ci
80+
event_type: downstream-ci-hpc
81+
payload: '{"ecbuild": "ecmwf/ecbuild@${{ github.event.pull_request.head.sha || github.sha }}","skip_matrix_jobs": "nvidia-22.11"}'
82+
83+
# DISABLED FOR NOW UNTIL REPO IS SET UP FOR THIS
84+
# notify:
85+
# runs-on: ubuntu-latest
86+
# needs:
87+
# - downstream-ci
88+
# - private-downstream-ci
89+
# - downstream-ci-hpc
90+
# - private-downstream-ci-hpc
91+
# if: ${{ always() && !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
92+
# steps:
93+
# - name: Trigger Teams notification
94+
# uses: ecmwf-actions/notify-teams@v1
95+
# with:
96+
# incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }}
97+
# needs_context: ${{ toJSON(needs) }}

cmake/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8.5
1+
3.9.0

cmake/ecbuild_add_option.cmake

+25-11
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ macro( ecbuild_add_option )
109109
set( _p_DEFAULT ON )
110110
else()
111111
if( NOT _p_DEFAULT MATCHES "[Oo][Nn]" AND NOT _p_DEFAULT MATCHES "[Oo][Ff][Ff]" )
112-
ecbuild_critical("In macro ecbuild_add_option(), DEFAULT is either ON or OFF: \"${_p_DEFAULT}\"")
112+
ecbuild_critical("In macro ecbuild_add_option(), DEFAULT must be either ON or OFF, but found: \"${_p_DEFAULT}\"")
113113
endif()
114114
endif()
115115
ecbuild_debug("ecbuild_add_option(${_p_FEATURE}): defaults to ${_p_DEFAULT}")
@@ -153,12 +153,6 @@ macro( ecbuild_add_option )
153153
# define the option -- for cmake GUI
154154

155155
option( ENABLE_${_p_FEATURE} "${_p_DESCRIPTION}" ${_p_DEFAULT} )
156-
get_property( _feature_desc GLOBAL PROPERTY _CMAKE_${_p_FEATURE}_DESCRIPTION )
157-
if( _feature_desc )
158-
add_feature_info( ${_p_FEATURE} ENABLE_${_p_FEATURE} "${_feature_desc}, ${PROJECT_NAME}: ${_p_DESCRIPTION}" )
159-
else()
160-
add_feature_info( ${_p_FEATURE} ENABLE_${_p_FEATURE} "${PROJECT_NAME}: ${_p_DESCRIPTION}" )
161-
endif()
162156

163157
ecbuild_debug("ecbuild_add_option(${_p_FEATURE}): defining option ENABLE_${_p_FEATURE} '${_p_DESCRIPTION}' ${_p_DEFAULT}")
164158
ecbuild_debug("ecbuild_add_option(${_p_FEATURE}): ENABLE_${_p_FEATURE}=${ENABLE_${_p_FEATURE}}")
@@ -176,6 +170,26 @@ macro( ecbuild_add_option )
176170
set( ENABLE_${_p_FEATURE} ${${PNAME}_ENABLE_${_p_FEATURE}} )
177171
endif()
178172

173+
## Update the description of the feature summary
174+
# Choose the correct tick
175+
if (ENABLE_${_p_FEATURE})
176+
set ( _tick "✔")
177+
else()
178+
set ( _tick "✘")
179+
endif()
180+
set(_enabled "${ENABLE_${_p_FEATURE}}")
181+
get_property( _enabled_features GLOBAL PROPERTY ENABLED_FEATURES )
182+
if( "${_p_FEATURE}" IN_LIST _enabled_features )
183+
set(_enabled ON)
184+
endif()
185+
# Retrieve any existing description (n.b. occurs when the same feature is added at multiple projects)
186+
get_property( _feature_desc GLOBAL PROPERTY _CMAKE_${_p_FEATURE}_DESCRIPTION )
187+
# Append the new description
188+
if( _feature_desc )
189+
add_feature_info( ${_p_FEATURE} ${_enabled} "${_feature_desc}, ${PROJECT_NAME}(${_tick}): '${_p_DESCRIPTION}'" )
190+
else()
191+
add_feature_info( ${_p_FEATURE} ${_enabled} "${PROJECT_NAME}(${_tick}): '${_p_DESCRIPTION}'" )
192+
endif()
179193

180194
set( ${PROJECT_NAME}_HAVE_${_p_FEATURE} 0 )
181195

@@ -250,7 +264,7 @@ macro( ecbuild_add_option )
250264

251265
else() # if user provided input and we cannot satisfy FAIL otherwise WARN
252266

253-
ecbuild_disable_feature( ${_p_FEATURE} )
267+
ecbuild_disable_unused_feature( ${_p_FEATURE} )
254268

255269
if( ${_p_FEATURE}_user_provided_input )
256270
if( NOT _${_p_FEATURE}_condition )
@@ -267,16 +281,16 @@ macro( ecbuild_add_option )
267281
ecbuild_info( "Feature ${_p_FEATURE} was not enabled (also not requested) -- following required packages weren't found: ${_failed_to_find_packages}" )
268282
endif()
269283
set( ENABLE_${_p_FEATURE} OFF )
270-
ecbuild_disable_feature( ${_p_FEATURE} )
284+
ecbuild_disable_unused_feature( ${_p_FEATURE} )
271285
endif()
272286

273287
endif()
274288

275289
else()
276290

277-
ecbuild_debug("ecbuild_add_option(${_p_FEATURE}): feature disabled")
291+
ecbuild_info( "Feature ${_p_FEATURE} disabled" )
278292
set( ${PROJECT_NAME}_HAVE_${_p_FEATURE} 0 )
279-
ecbuild_disable_feature( ${_p_FEATURE} )
293+
ecbuild_disable_unused_feature( ${_p_FEATURE} )
280294

281295
endif()
282296

0 commit comments

Comments
 (0)