Skip to content

Commit

Permalink
Merge pull request cyclus#1770 from cyclus/upstream/noble-numbat
Browse files Browse the repository at this point in the history
Add Ubuntu 24.04 to CI (Replacement)
  • Loading branch information
gonuke authored Jul 18, 2024
2 parents bef0870 + baefb63 commit 1ce434e
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 27 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
ubuntu_versions : [
20.04,
22.04,
24.04,
]
pkg_mgr : [
apt,
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
ubuntu_versions : [
20.04,
22.04,
24.04,
]
pkg_mgr : [
apt,
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
ubuntu_versions : [
20.04,
22.04,
24.04,
]
pkg_mgr : [
apt,
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Since last release
====================

**Added:**

* Added TransportUnits (#1750, #1772)
* Added CI support for Ubuntu 24.04 (#1770)

**Changed:**

Expand Down
47 changes: 24 additions & 23 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ARG pkg_mgr=apt
ARG ubuntu_version=22.04
ARG ubuntu_version=24.04

FROM ubuntu:${ubuntu_version} as common-base
FROM ubuntu:${ubuntu_version} AS common-base

ENV TZ=America/Chicago
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

FROM common-base as apt-deps
FROM common-base AS apt-deps

RUN apt update -y && apt install -y \
g++ \
Expand Down Expand Up @@ -39,7 +39,7 @@ RUN apt clean -y all

RUN mkdir -p `python3 -m site --user-site`

FROM common-base as conda-deps
FROM common-base AS conda-deps

RUN apt update -y && apt install -y \
wget \
Expand All @@ -52,7 +52,7 @@ RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
/bin/bash ~/miniforge.sh -b -p /opt/conda && \
rm ~/miniforge.sh

ENV PATH /opt/conda/bin:$PATH
ENV PATH=/opt/conda/bin:$PATH
RUN mamba update -n base conda mamba && \
mamba update -y python --no-pin && \
mamba update -y --all && \
Expand Down Expand Up @@ -84,39 +84,40 @@ RUN mamba update -n base conda mamba && \
&& \
mamba clean -y --all
RUN mkdir -p $(python3 -m site --user-site)
ENV CC /opt/conda/bin/x86_64-conda-linux-gnu-gcc
ENV CXX /opt/conda/bin/x86_64-conda-linux-gnu-g++
ENV CPP /opt/conda/bin/x86_64-conda-linux-gnu-cpp
ENV CC=/opt/conda/bin/x86_64-conda-linux-gnu-gcc
ENV CXX=/opt/conda/bin/x86_64-conda-linux-gnu-g++
ENV CPP=/opt/conda/bin/x86_64-conda-linux-gnu-cpp

FROM apt-deps as apt-coverage-deps
FROM apt-deps AS apt-coverage-deps
RUN apt install -y lcov curl
ENV GCOV /usr/bin/gcov
ENV GCOV=/usr/bin/gcov

FROM conda-deps as conda-coverage-deps
FROM conda-deps AS conda-coverage-deps
RUN mamba install -y lcov curl
ENV GCOV /opt/conda/bin/x86_64-conda-linux-gnu-gcov
ENV GCOV=/opt/conda/bin/x86_64-conda-linux-gnu-gcov

FROM ${pkg_mgr}-coverage-deps as cyclus-coverage
FROM ${pkg_mgr}-coverage-deps AS cyclus-coverage
ARG make_cores=2

COPY . /cyclus
WORKDIR /cyclus

RUN python3 install.py -j ${make_cores} --allow-milps --code-coverage

ENV PATH /root/.local/bin:$PATH
RUN lcov -c -d /cyclus -o initial_coverage.info --gcov-tool ${GCOV} --initial --no-external && \
ENV PATH=/root/.local/bin:$PATH
ENV LCOV_ARGS="--gcov-tool=${GCOV} --no-external"
RUN lcov -c -d /cyclus -o initial_coverage.info --initial ${LCOV_ARGS} && \
cyclus_unit_tests && \
cd tests && python3 -m pytest && cd .. && \
lcov -c -d /cyclus -o test_coverage.info --gcov-tool ${GCOV} --no-external && \
lcov -c -d /cyclus -o test_coverage.info ${LCOV_ARGS} && \
lcov --add-tracefile initial_coverage.info --add-tracefile test_coverage.info -o temp_coverage.info && \
lcov --remove temp_coverage.info -o total_coverage.info '/cyclus/build/_deps/**' && \
mkdir -p html && genhtml total_coverage.info --output-directory html

FROM scratch as coverage-report
FROM scratch AS coverage-report
COPY --from=cyclus-coverage /cyclus /

FROM ${pkg_mgr}-deps as cyclus
FROM ${pkg_mgr}-deps AS cyclus
ARG make_cores=2

COPY . /cyclus
Expand All @@ -129,19 +130,19 @@ WORKDIR /cyclus
# You may add the option "--cmake-debug" to the following command
# for further CMake debugging.
RUN python3 install.py -j ${make_cores} --allow-milps
ENV PATH /root/.local/bin:$PATH
ENV PATH=/root/.local/bin:$PATH

FROM cyclus as deb-generation
FROM cyclus AS deb-generation
WORKDIR /cyclus/build
RUN make package

FROM scratch as deb-package
FROM scratch AS deb-package
COPY --from=deb-generation /cyclus/build/cyclus*.deb /

FROM cyclus as cyclus-test
FROM cyclus AS cyclus-test

RUN cyclus_unit_tests

FROM cyclus-test as cyclus-pytest
FROM cyclus-test AS cyclus-pytest

RUN cd tests && python3 -m pytest
13 changes: 9 additions & 4 deletions src/xml_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,19 @@ xmlpp::Document* XMLParser::Document() {
// This adds the capability to have nice include semantics
bool generate_xinclude_nodes = true;
bool fixup_base_uris = false;
#if LIBXMLXX_MAJOR_VERSION == 2
doc->process_xinclude(generate_xinclude_nodes);
#if LIBXMLXX_MAJOR_VERSION == 2
#if LIBXMLXX_MINOR_VERSION < 42
doc->process_xinclude(generate_xinclude_nodes);
#else
doc->process_xinclude(generate_xinclude_nodes, fixup_base_uris);
#endif
#else
doc->process_xinclude(generate_xinclude_nodes, fixup_base_uris);
doc->process_xinclude(generate_xinclude_nodes, fixup_base_uris);
#endif
// This removes the stupid xml:base attribute that including adds,
// but which is unvalidatable. The web is truly cobbled together
// by a race of evil gnomes.
// by a race of evil gnomes. After libxml++ v2.42.0 process_xinclude
// supports the fixup_base_uris which does this removal for us
xmlpp::Element* root = doc->get_root_node();
NodeSet have_base = root->find("//*[@xml:base]");
NodeSet::iterator it = have_base.begin();
Expand Down

0 comments on commit 1ce434e

Please sign in to comment.