diff --git a/.cd/.conda/build.sh b/.cd/.conda/build.sh new file mode 100644 index 000000000..47e65b0c0 --- /dev/null +++ b/.cd/.conda/build.sh @@ -0,0 +1,83 @@ + +#!/usr/bin/env bash + +set -e # Abort on error. +set -x # Display executed commands + +ENABLE_SSL=ON +ENABLE_PYTHON=ON +ENABLE_HTTP=ON +ENABLE_UDP=ON +ENABLE_UI=ON + +# find the boost libs/includes we need +export LDFLAGS="$LDFLAGS -L$PREFIX/lib -Wl,-rpath,$PREFIX/lib" +export CFLAGS="$CFLAGS -fPIC -I$PREFIX/include" + + +if [[ $(uname) == Darwin && ${target_platform} == osx-64 ]]; then + # Disable use of std::aligned_alloc by boost, as this is not available on macOS 10.9 + export CXXFLAGS="$CXXFLAGS -DBOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC" + + # https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk + export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" + + # Disable ecflow_http build, as it uses C++17 features only available on macOS 10.12+ + ENABLE_HTTP=OFF + # Disable ecflow_udp build, as it uses C++17 features only available on macOS 10.13+ + ENABLE_UDP=OFF +fi + +# Diagnostic information +${CXX} --version +${CXX} -dM -E - < +HERE + +export UNDEF_LOOKUP=0 +if [[ $(uname) == Darwin ]]; then + export UNDEF_LOOKUP=1 +fi + +mkdir build && cd build + +conda info + +echo "which python" +which python +echo "python version" +python --version + +cmake ${CMAKE_ARGS} \ + -D CMAKE_INSTALL_PREFIX=$PREFIX \ + -D ENABLE_PYTHON=$ENABLE_PYTHON \ + -D ENABLE_SSL=$ENABLE_SSL \ + -D ENABLE_HTTP=$ENABLE_HTTP \ + -D ENABLE_UDP=$ENABLE_UDP \ + -D ENABLE_UI=$ENABLE_UI \ + -D BOOST_ROOT=$PREFIX \ + -D ECBUILD_LOG_LEVEL=DEBUG \ + -D ENABLE_STATIC_BOOST_LIBS=OFF \ + -D Python3_FIND_STRATEGY=LOCATION \ + -D Python3_EXECUTABLE=$PYTHON \ + -D ENABLE_PYTHON_UNDEF_LOOKUP=$UNDEF_LOOKUP \ + -D Cereal_INCLUDE_DIRS=../3rdparty/cereal/include \ + -D JSON_INCLUDE_DIRS=../3rdparty/json/include \ + -D HTTPLIB_INCLUDE_DIRS=../3rdparty/cpp-httplib/include \ + .. + +make -j $CPU_COUNT VERBOSE=1 + + +# only run certain tests +if [[ $(uname) == Linux ]]; then + echo "1,2,3,4,5,6,7,8" > ./test_list.txt +elif [[ $(uname) == Darwin ]]; then + echo "1,2,3,4,5,6,8" > ./test_list.txt +fi + +if [[ "${CONDA_BUILD_CROSS_COMPILATION:-}" != "1" || "${CROSSCOMPILING_EMULATOR}" != "" ]]; then +ctest -VV -I ./test_list.txt +fi + +make install diff --git a/.cd/.conda/conda_build_config_common.yaml b/.cd/.conda/conda_build_config_common.yaml new file mode 100644 index 000000000..f2929c90e --- /dev/null +++ b/.cd/.conda/conda_build_config_common.yaml @@ -0,0 +1,20 @@ +c_compiler: +- gcc +c_compiler_version: +- '15' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' +cdt_name: +- conda +cxx_compiler: +- gxx +cxx_compiler_version: +- '15' +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +qt_main: +- '5.15' \ No newline at end of file diff --git a/.cd/.conda/conda_build_config_py312.yaml b/.cd/.conda/conda_build_config_py312.yaml new file mode 100644 index 000000000..bfd3a64c1 --- /dev/null +++ b/.cd/.conda/conda_build_config_py312.yaml @@ -0,0 +1,2 @@ +python: +- 3.12.* *_cpython \ No newline at end of file diff --git a/.cd/.conda/meta.yaml b/.cd/.conda/meta.yaml new file mode 100644 index 000000000..5c4df38ea --- /dev/null +++ b/.cd/.conda/meta.yaml @@ -0,0 +1,65 @@ +{% set name = "ecFlow" %} +{% set git_tag = environ.get('GIT_DESCRIBE_TAG', '0.0.0').lstrip('v') %} +{% set version = git_tag.replace('-', '') | lower %} + +package: + name: {{ name|lower }} + version: {{ version }} + +source: + path: ../.. + +build: + number: 0 + skip: true # [win] + +requirements: + build: + - python # [build_platform != target_platform] + - cross-python_{{ target_platform }} # [build_platform != target_platform] + - cmake + - make + - ecbuild + - {{ compiler('c') }} + - {{ stdlib("c") }} + - {{ compiler('cxx') }} + - {{ cdt('mesa-libgl-devel') }} # [linux] + - {{ cdt('mesa-dri-drivers') }} # [linux] + - {{ cdt('libselinux') }} # [linux] + - {{ cdt('libxdamage') }} # [linux] + - {{ cdt('libxfixes') }} # [linux] + - {{ cdt('libxxf86vm') }} # [linux] + - {{ cdt('libxcb') }} # [linux] + - {{ cdt('libxext') }} # [linux] + - {{ cdt('libxau') }} # [linux] + host: + - python + - libboost-python-devel + - qt-main + - xorg-libxfixes # [linux] + - zlib # [linux] + - libxcrypt # [linux] + run: + - python + - qt-main + - libboost-python-devel + - zlib # [linux] + - libxcrypt # [linux] + +test: + commands: + - ecflow_client --help + - ecflow_server --help + - ecflow_standalone -v + +about: + home: https://ecflow.readthedocs.io/en/latest/ + license: Apache-2.0 + license_family: Apache + license_file: LICENSE + summary: ECMWF ecFlow + +extra: + recipe-maintainers: + - marcosbento + - iainrussell \ No newline at end of file diff --git a/.github/cd-config.yml b/.github/cd-config.yml new file mode 100644 index 000000000..1bd26fdf4 --- /dev/null +++ b/.github/cd-config.yml @@ -0,0 +1,9 @@ +builds: + - name: "conda-build" + type: "conda" + enabled: true + config: + conda_build_args: "-m .cd/.conda/conda_build_config_common.yaml -m .cd/.conda/conda_build_config_py312.yaml --no-anaconda-upload" + +release: + enabled: true \ No newline at end of file diff --git a/.github/workflows/all-cd.yml b/.github/workflows/all-cd.yml new file mode 100644 index 000000000..2252d3114 --- /dev/null +++ b/.github/workflows/all-cd.yml @@ -0,0 +1,26 @@ +name: All CD + +on: + push: + tags: + - 'v?[0-9]+.[0-9]+.[0-9]+' + - 'v?[0-9]+.[0-9]+.[0-9]+-*' + branches: + - '*' + pull_request: + types: [opened, synchronize, reopened, labeled] + workflow_dispatch: + +permissions: + contents: write + +jobs: + build-and-release: + if: | + startsWith(github.ref, 'refs/tags/') || + github.ref_name == github.event.repository.default_branch || + (github.event.pull_request.base.ref == github.event.repository.default_branch && github.event.label.name == 'approved-for-cd') + uses: ecmwf/reusable-workflows/.github/workflows/main-cd.yml@debug-cd-conda + with: + ref_name: ${{ github.ref_name }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 954e8c77b..960165124 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,8 @@ on: - 'develop' tags-ignore: - '**' + paths-ignore: + - ".cd/**" # Trigger the workflow on pull request pull_request: ~