Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature-gh-actions' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipFackler committed Nov 19, 2024
2 parents 59ffced + face77a commit 5e4961d
Show file tree
Hide file tree
Showing 14 changed files with 527 additions and 328 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/ci-github-actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: GitHub Actions CI

on:
push:
branches:
- stable
- develop
pull_request:
branches:
- develop

jobs:

linux:
runs-on: ubuntu-latest
container: ${{ matrix.container }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_JOBNAME: ${{ matrix.jobname }}
GH_OS: Linux
strategy:
fail-fast: false
matrix:
jobname: [
ubuntu22-gcc,
ubuntu22-clang,
]
include:
- jobname: ubuntu22-gcc
container:
image: ghcr.io/philipfackler/xolotl-ci:ubuntu22-dev
options: -u root
- jobname: ubuntu22-clang
container:
image: ghcr.io/philipfackler/xolotl-ci:ubuntu22-dev
options: -u root

steps:
- name: Checkout Action
uses: actions/checkout@v1

- name: Configure
run: CI/scripts/run_step.sh configure

- name: Build
run: CI/scripts/run_step.sh build

- name: Test
run: CI/scripts/run_step.sh test


macos:
runs-on: macos-latest
env:
GH_YML_JOBNAME: ${{ matrix.jobname }}
GH_YML_OS: macOS

strategy:
fail-fast: false
matrix:
jobname: [
macos1015-xcode11
]

steps:
- name: Checkout Action
uses: actions/checkout@v1

- name: Setup Dependencies
run: |
brew install boost open-mpi hdf5-mpi make [email protected]
echo "PATH=/opt/homebrew/opt/[email protected]/libexec/bin:$PATH" >> $GITHUB_ENV
- name: Configure
run: |
export EXTRA_CMAKE_ARGS='-DXolotl_INCLUDE_RN_TPP_FILES=ON -DXolotl_ENABLE_TIMER_TESTS=OFF'
CI/scripts/run_step.sh configure
env:
PATH: ${{ env.PATH }}

- name: Build
run: CI/scripts/run_step.sh build

- name: Test
run: CI/scripts/run_step.sh test
34 changes: 34 additions & 0 deletions CI/docker/ubuntu22/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND noninteractive

# Install dependencies
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get install -y \
python3 \
clang \
clang-tidy \
g++ \
git \
gdb \
make \
cmake \
cmake-curses-gui \
mpi-default-dev \
libblas-dev \
liblapack-dev \
libhdf5-mpi-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-test-dev \
libboost-log-dev \
bzip2 \
sudo

RUN useradd -mr -u 10000 builduser
RUN adduser builduser sudo
RUN echo "builduser:builduser" | chpasswd

USER builduser
WORKDIR /home/builduser
67 changes: 67 additions & 0 deletions CI/scripts/run_step.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash

set -e

echo -e "\nCheck gcc and clang compilers\n"
gcc --version
clang --version

function run_tests () {
cd ${GITHUB_WORKSPACE}/../build
ctest --output-on-failure --label-exclude xolotl.tests.system
local __xolotl_ret=$?
./test/system/SystemTester -- -t
local __xolotl_sys_ret=$?
return $((__xolotl_ret + __xolotl_sys_ret))
}

case "$1" in

configure)

git config --global --add safe.directory ${GITHUB_WORKSPACE}

case "${GH_JOBNAME}" in
*"clang"*)
export CC=clang
export CXX=clang++
export OMPI_CC=clang
export OMPI_CXX=clang++
;;
*)
;;
esac

cd ${GITHUB_WORKSPACE}/..

git clone https://gitlab.com/petsc/petsc.git -b v3.21.6 petsc
cd petsc
bash ${GITHUB_WORKSPACE}/../xolotl/scripts/build_petsc.sh \
--prefix=${GITHUB_WORKSPACE}/../install \
--skip-pull

cd ${GITHUB_WORKSPACE}/..
mkdir build
cd build

cmake \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/../install \
${EXTRA_CMAKE_ARGS} \
${GITHUB_WORKSPACE}

;;

build)
cd ${GITHUB_WORKSPACE}/../build
make -j4
;;

test)
run_tests
;;

*)
echo " Invalid step" "$1"
exit -1
;;
esac
3 changes: 3 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ get_filename_component(XOLOTL_TEST_DATA_DIR
)
set(XOLOTL_BUILD_DIR ${CMAKE_BINARY_DIR})

option(Xolotl_ENABLE_TIMER_TESTS "Include tests for accurate timing" ON)
set(XOLOTL_ENABLE_TIMER_TESTS ${Xolotl_ENABLE_TIMER_TESTS})

execute_process(COMMAND
${CMAKE_COMMAND} -E make_directory ${XOLOTL_BINARY_INCLUDE_DIR}/xolotl/test
)
Expand Down
2 changes: 2 additions & 0 deletions test/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
#define XOLOTL_BUILD_DIR @XOLOTL_BUILD_DIR@

#define XOLOTL_TEST_DATA_DIR @XOLOTL_TEST_DATA_DIR@

#cmakedefine XOLOTL_ENABLE_TIMER_TESTS
9 changes: 7 additions & 2 deletions test/perf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ list(APPEND tests
dummy/DummyEventCounterTester.cpp
dummy/DummyHardwareCounterTester.cpp
dummy/DummyTimerTester.cpp
os/OSTimerTester.cpp
)

if(Xolotl_ENABLE_TIMER_TESTS)
list(APPEND tests os/OSTimerTester.cpp)
endif()

if(PAPI_FOUND)
list(APPEND tests
papi/PAPIHardwareCounterTester.cpp
papi/PAPITimerTester.cpp
)
if(Xolotl_ENABLE_TIMER_TESTS)
list(APPEND tests papi/PAPITimerTester.cpp)
endif()
endif(PAPI_FOUND)

if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
Expand Down
3 changes: 3 additions & 0 deletions test/perf/PerfHandlerTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <xolotl/perf/IPerfHandler.h>
#include <xolotl/perf/PerfObjStatistics.h>
#include <xolotl/test/MPITestUtils.h>
#include <xolotl/test/config.h>

using namespace xolotl;

Expand Down Expand Up @@ -122,10 +123,12 @@ BOOST_AUTO_TEST_CASE(aggregateStats)
BOOST_REQUIRE_EQUAL(timerStatsObj.name, "testTimer");
BOOST_REQUIRE_EQUAL(
timerStatsObj.processCount, (unsigned int)cwSize);
#ifdef XOLOTL_ENABLE_TIMER_TESTS
BOOST_REQUIRE_CLOSE(timerStatsObj.average, nTimedSeconds, 0.03);
BOOST_REQUIRE_CLOSE(timerStatsObj.min, nTimedSeconds, 0.03);
BOOST_REQUIRE_CLOSE(timerStatsObj.max, nTimedSeconds, 0.03);
BOOST_REQUIRE_SMALL(timerStatsObj.stdev, 0.001);
#endif

// Next check counts. We can compute exactly what the values
// should be.
Expand Down
10 changes: 5 additions & 5 deletions xolotl/core/include/xolotl/core/flux/FluxHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class FluxHandler : public IFluxHandler
/**
* \see IFluxHandler.h
*/
virtual void
void
computeIncidentFlux(double currentTime, Kokkos::View<const double*>,
Kokkos::View<double*> updatedConcOffset, int xi,
int surfacePos) override;
Expand Down Expand Up @@ -230,17 +230,17 @@ class FluxHandler : public IFluxHandler
/**
* \see IFluxHandler.h
*/
virtual void
setFissionYield(double yield)
void
setFissionYield(double yield) override
{
return;
}

/**
* \see IFluxHandler.h
*/
virtual std::vector<std::pair<IdType, double>>
getImplantedFlux(std::vector<IdType> map)
std::vector<std::pair<IdType, double>>
getImplantedFlux(std::vector<IdType> map) override
{
return std::vector<std::pair<IdType, double>>();
}
Expand Down
4 changes: 2 additions & 2 deletions xolotl/core/include/xolotl/core/flux/FuelFitFluxHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ class FuelFitFluxHandler : public FluxHandler
/**
* \see IFluxHandler.h
*/
virtual void
setFissionYield(double yield)
void
setFissionYield(double yield) override
{
xeYield = yield;
}
Expand Down
Loading

0 comments on commit 5e4961d

Please sign in to comment.