Skip to content

Commit

Permalink
Merge pull request cyclus#1588 from cyclus/2023-maintenance-update
Browse files Browse the repository at this point in the history
2023 maintenance update
  • Loading branch information
abachma2 authored Sep 27, 2023
2 parents c1910b9 + eeadd8c commit af366c0
Show file tree
Hide file tree
Showing 67 changed files with 851 additions and 1,584 deletions.
50 changes: 0 additions & 50 deletions .github/workflows/build_test.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/build_test_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build, Test & Publish docker images for future CI and other users

on:
# allows us to run workflows manually
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
build-dependency-and-test-img:
runs-on: ubuntu-latest

strategy:
matrix:
ubuntu_versions : [
22.04,
]
pkg_mgr : [
apt,
conda,
]

name: Installing Dependencies, Building cyclus and running tests
steps:
- name: default environment
run: |
echo "tag-latest-on-default=false" >> "$GITHUB_ENV"
- name: condition on trigger parameters
if: ${{ github.repository_owner == 'cyclus' && github.ref == 'refs/heads/main' }}
run: |
echo "tag-latest-on-default=true" >> "$GITHUB_ENV"
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout repository
uses: actions/checkout@v3

- name: Installing Dependencies in Docker image
uses: firehed/multistage-docker-build-action@v1
with:
repository: ghcr.io/${{ github.repository_owner }}/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}
stages: ${{ matrix.pkg_mgr }}-deps, cyclus
server-stage: cyclus-test
quiet: false
parallel: true
tag-latest-on-default: ${{ env.tag-latest-on-default }}
dockerfile: docker/Dockerfile
build-args: pkg_mgr=${{ matrix.pkg_mgr }}
18 changes: 12 additions & 6 deletions .github/workflows/changelog_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ env:

jobs:
changelog_update:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
container:
image: alpine:3.14
Expand All @@ -23,10 +22,17 @@ jobs:
git --version
- name: Checkout repository
uses: actions/checkout@v2
- name: Housekeeping
run: |
uses: actions/checkout@v3

- run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
cd $GITHUB_WORKSPACE
housekeeping_script/changelog_test.sh
git remote add cyclus https://github.com/cyclus/cyclus.git
git fetch cyclus
change=`git diff cyclus/main -- CHANGELOG.rst | wc -l`
git remote remove cyclus
if [ $change -eq 0 ]; then
echo "CHANGELOG.rst has not been updated"
exit 1
fi
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Since last release
**Changed:**

* Moved to unified CHANGELOG Entry and check them with GithubAction (#1571)

* Major update and modernization of build (#1587)
* Changed Json formatting for compatibility with current python standards (#1587)

**Removed:**

Expand Down
75 changes: 38 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.16)
#taken from http://geant4.cern.ch/support/source/geant4/CMakeLists.txt
IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(STATUS "Cyclus requires an out-of-source build.")
Expand All @@ -10,20 +10,16 @@ IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "in-source build detected")
ENDIF()

# Set some policies
cmake_policy(SET CMP0040 OLD)
cmake_policy(SET CMP0042 OLD)

# This project name is cyclus.
PROJECT(CYCLUS)

# check for and enable c++11 support (required for cyclus)
# check for and enable c++17 support (required for cyclus)
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
IF(COMPILER_SUPPORTS_CXX11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
IF(COMPILER_SUPPORTS_CXX17)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
ELSE()
MESSAGE(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
MESSAGE(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++17 support. Please use a different C++ compiler.")
ENDIF()

# enable assembly
Expand Down Expand Up @@ -108,8 +104,9 @@ IF(NOT CYCLUS_DOC_ONLY)
endif()

# Tell CMake where the modules are
LIST(APPEND CMAKE_MODULE_PATH
"${CMAKE_DIR}/share/cmake-2.8/Modules" "${PROJECT_SOURCE_DIR}/cmake")
MESSAGE("-- CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${PROJECT_SOURCE_DIR}/cmake")

# Include macros
INCLUDE(CopyWhenDiffMacro)
Expand Down Expand Up @@ -162,24 +159,29 @@ IF(NOT CYCLUS_DOC_ONLY)
MESSAGE("-- Dependency Binary Hints (DEPS_BIN_HINTS): ${DEPS_BIN_HINTS}")
MESSAGE("-- Dependency Library Hints (DEPS_LIB_HINTS): ${DEPS_LIB_HINTS}")
MESSAGE("-- Dependency Include Hints (DEPS_INCLUDE_HINTS): ${DEPS_INCLUDE_HINTS}")
MESSAGE("CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")

# Search pkg-config utility first
find_package(PkgConfig REQUIRED)


# Debian installs useful LibXML2 files to /usr/include/libxml2/libxml
# libxml2 is required for relaxng schema validation
FIND_PACKAGE(LibXml2 ${DEPS_HINTS})
IF(NOT LIBXML2_LIBRARIES)
FIND_LIBRARY(LibXml2 REQUIRED ${DEPS_HINTS})
ENDIF()

FIND_PACKAGE(LibXml2 REQUIRED)
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
SET(LIBS ${LIBS} ${LIBXML2_LIBRARIES})

# Find LibXML++ and dependencies
FIND_PACKAGE(LibXML++)
IF(NOT LibXML++_LIBRARIES)
FIND_LIBRARY(LibXML++ REQUIRED ${DEPS_HINTS})
ENDIF()
SET(LIBS ${LIBS} ${LibXML++_LIBRARIES})
message("-- LibXML++ Include Dir: ${LibXML++_INCLUDE_DIR}")

message("-- LibXML2 Include Dir: ${LIBXML2_INCLUDE_DIR}")

# Then use pkg-config for locate specific package
pkg_check_modules(LIBXMLXX IMPORTED_TARGET libxml++-4.0)
IF ( NOT LIBXMLXX_LIBRARIES )
pkg_check_modules(LIBXMLXX REQUIRED IMPORTED_TARGET libxml++-2.6)
ENDIF ( NOT LIBXMLXX_LIBRARIES )
SET(LIBS ${LIBS} ${LIBXMLXX_LIBRARIES})
message("-- LibXML++ Include Dir: ${LIBXMLXX_INCLUDE_DIRS}")
message("-- LibXML++ Librarires: ${LIBXMLXX_LIBRARIES}")

# find lapack and link to it
FIND_PACKAGE(LAPACK REQUIRED)
set(LIBS ${LIBS} ${LAPACK_LIBRARIES})
Expand All @@ -188,8 +190,9 @@ IF(NOT CYCLUS_DOC_ONLY)
MESSAGE("-- Found BLAS Libraries: ${BLAS_LIBRARIES}")

# Find Sqlite3
FIND_PACKAGE(Sqlite3 REQUIRED)
SET(LIBS ${LIBS} ${SQLITE3_LIBRARIES})
FIND_PACKAGE(SQLite3 REQUIRED)
SET(LIBS ${LIBS} ${SQLite3_LIBRARIES})
MESSAGE("-- Found SQLite3 Libraries: ${SQLite3_LIBRARIES}")

# Find HDF5
FIND_PACKAGE(HDF5 REQUIRED COMPONENTS HL)
Expand Down Expand Up @@ -300,8 +303,8 @@ IF(NOT CYCLUS_DOC_ONLY)
# Cython & Python Bindings
#
# Use new Python library finder
find_package(PythonInterp)
find_package(PythonLibs)
find_package (Python3 COMPONENTS Interpreter Development NumPy)

execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
"import site; print(site.getsitepackages(['${CMAKE_INSTALL_PREFIX}'])[0])"
OUTPUT_VARIABLE PYTHON_SITE_PACKAGES
Expand All @@ -321,7 +324,6 @@ IF(NOT CYCLUS_DOC_ONLY)
endif()
include(UseCython)

find_package(Numpy REQUIRED)
find_package(Jinja2 REQUIRED)
find_package(Pandas REQUIRED)

Expand Down Expand Up @@ -362,10 +364,10 @@ IF(NOT CYCLUS_DOC_ONLY)
# ${Glibmm_INCLUDE_DIRS} breaks Ubuntu 12.04
set(inc_dirs
"${LIBXML2_INCLUDE_DIR}"
"${LibXML++_INCLUDE_DIR}"
"${LIBXMLXX_INCLUDE_DIRS}"
"${Glibmm_INCLUDE_DIRS}"
"${LibXML++Config_INCLUDE_DIR}"
"${SQLITE3_INCLUDE_DIR}"
"${LIBXMLXXConfig_INCLUDE_DIR}"
"${SQLite3_INCLUDE_DIR}"
"${HDF5_INCLUDE_DIRS}"
"${Boost_INCLUDE_DIR}"
"${COIN_INCLUDE_DIRS}")
Expand All @@ -376,8 +378,7 @@ IF(NOT CYCLUS_DOC_ONLY)


if(Cython_FOUND)
INCLUDE_DIRECTORIES(AFTER "${PYTHON_INCLUDE_DIRS}"
"${NUMPY_INCLUDE_DIRS}")
INCLUDE_DIRECTORIES(AFTER "${PYTHON_INCLUDE_DIRS}" "${_Python3_NumPy_INCLUDE_DIR}")
endif(Cython_FOUND)
# set core version, one way or the other
IF(NOT "${CORE_VERSION}" STREQUAL "")
Expand All @@ -403,7 +404,7 @@ IF(NOT CYCLUS_DOC_ONLY)
if(Cython_FOUND)
ADD_SUBDIRECTORY("${CYCLUS_PYSOURCE_DIR}")
endif(Cython_FOUND)

##############################################################################################
####################################### end includes #########################################
##############################################################################################
Expand Down Expand Up @@ -489,7 +490,7 @@ IF(NOT CYCLUS_DOC_ONLY)
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-program-options-dev (>= 1.54.0)")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-serialization-dev (>= 1.54.0)")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libhdf5-dev (>= 1.8.11)")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libxml++2.6-dev (>= 2.36.0)")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libxml++2.6-dev (>= 2.6.0)")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, coinor-libcbc-dev (>= 2.8.7)")
MESSAGE("CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS}")

Expand Down
Loading

0 comments on commit af366c0

Please sign in to comment.