mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Merge pull request #1736 from pshriwise/github_actions_ci
GitHub Actions CI
This commit is contained in:
commit
d1e7745dd9
11 changed files with 143 additions and 75 deletions
122
.github/workflows/ci.yml
vendored
Normal file
122
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
# allows us to run workflows manually
|
||||
workflow_dispatch:
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
- master
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- master
|
||||
|
||||
env:
|
||||
MPI_DIR: /usr
|
||||
HDF5_ROOT: /usr
|
||||
OMP_NUM_THREADS: 2
|
||||
COVERALLS_PARALLEL: true
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-16.04
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.8]
|
||||
mpi: [n, y]
|
||||
omp: [n, y]
|
||||
dagmc: [n]
|
||||
event: [n]
|
||||
vectfit: [n]
|
||||
|
||||
include:
|
||||
- python-version: 3.6
|
||||
omp: n
|
||||
mpi: n
|
||||
- python-version: 3.7
|
||||
omp: n
|
||||
mpi: n
|
||||
- dagmc: y
|
||||
python-version: 3.8
|
||||
mpi: y
|
||||
omp: y
|
||||
- event: y
|
||||
python-version: 3.8
|
||||
omp: y
|
||||
mpi: n
|
||||
- vectfit: y
|
||||
python-version: 3.8
|
||||
omp: n
|
||||
mpi: y
|
||||
|
||||
env:
|
||||
MPI: ${{ matrix.mpi }}
|
||||
PHDF5: ${{ matrix.mpi }}
|
||||
OMP: ${{ matrix.omp }}
|
||||
DAGMC: ${{ matrix.dagmc }}
|
||||
EVENT: ${{ matrix.event }}
|
||||
VECTFIT: ${{ matrix.vectfit }}
|
||||
|
||||
steps:
|
||||
-
|
||||
uses: actions/checkout@v2
|
||||
|
||||
-
|
||||
name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
-
|
||||
name: Environment Variables
|
||||
run: |
|
||||
echo "DAGMC_ROOT=$HOME/DAGMC"
|
||||
echo "OPENMC_CROSS_SECTIONS=$HOME/nndc_hdf5/cross_sections.xml" >> $GITHUB_ENV
|
||||
echo "OPENMC_ENDF_DATA=$HOME/endf-b-vii.1" >> $GITHUB_ENV
|
||||
|
||||
-
|
||||
name: Apt dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt -y update
|
||||
sudo apt install -y mpich \
|
||||
libmpich-dev \
|
||||
libhdf5-serial-dev \
|
||||
libhdf5-mpich-dev \
|
||||
libeigen3-dev
|
||||
-
|
||||
name: install
|
||||
shell: bash
|
||||
run: |
|
||||
echo "$HOME/NJOY2016/build" >> $GITHUB_PATH
|
||||
$GITHUB_WORKSPACE/tools/ci/gha-install.sh
|
||||
-
|
||||
name: before
|
||||
shell: bash
|
||||
run: $GITHUB_WORKSPACE/tools/ci/gha-before-script.sh
|
||||
|
||||
-
|
||||
name: test
|
||||
shell: bash
|
||||
run: $GITHUB_WORKSPACE/tools/ci/gha-script.sh
|
||||
|
||||
-
|
||||
name: after_success
|
||||
shell: bash
|
||||
run: |
|
||||
cpp-coveralls -i src -i include --exclude-pattern "/usr/*" --dump cpp_cov.json
|
||||
coveralls --merge=cpp_cov.json
|
||||
|
||||
finish:
|
||||
needs: main
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Coveralls Finished
|
||||
uses: coverallsapp/github-action@master
|
||||
with:
|
||||
github-token: ${{ secrets.github_token }}
|
||||
parallel-finished: true
|
||||
60
.travis.yml
60
.travis.yml
|
|
@ -1,60 +0,0 @@
|
|||
|
||||
sudo: required
|
||||
dist: xenial
|
||||
language: python
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- mpich
|
||||
- libmpich-dev
|
||||
- libhdf5-serial-dev
|
||||
- libhdf5-mpich-dev
|
||||
- libeigen3-dev
|
||||
config:
|
||||
retries: true
|
||||
services:
|
||||
- xvfb
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/nndc_hdf5
|
||||
- $HOME/endf-b-vii.1
|
||||
env:
|
||||
global:
|
||||
- MPI_DIR=/usr
|
||||
- DAGMC_ROOT=$HOME/DAGMC
|
||||
- HDF5_ROOT=/usr
|
||||
- OMP_NUM_THREADS=2
|
||||
- OPENMC_CROSS_SECTIONS=$HOME/nndc_hdf5/cross_sections.xml
|
||||
- OPENMC_ENDF_DATA=$HOME/endf-b-vii.1
|
||||
- PATH=$PATH:$HOME/NJOY2016/build
|
||||
- COVERALLS_PARALLEL=true
|
||||
- NUMPY_EXPERIMENTAL_ARRAY_FUNCTION=0
|
||||
matrix:
|
||||
include:
|
||||
- python: "3.6"
|
||||
env: OMP=n MPI=n PHDF5=n
|
||||
- python: "3.7"
|
||||
env: OMP=n MPI=n PHDF5=n
|
||||
- python: "3.8"
|
||||
env: OMP=n MPI=n PHDF5=n
|
||||
- python: "3.8"
|
||||
env: OMP=y MPI=n PHDF5=n
|
||||
- python: "3.8"
|
||||
env: OMP=n MPI=y PHDF5=n VECTFIT=y
|
||||
- python: "3.8"
|
||||
env: OMP=n MPI=y PHDF5=y
|
||||
- python: "3.8"
|
||||
env: OMP=y MPI=y PHDF5=y DAGMC=y
|
||||
- python: "3.8"
|
||||
env: OMP=y MPI=n PHDF5=n EVENT=y
|
||||
notifications:
|
||||
webhooks: https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN
|
||||
install:
|
||||
- ./tools/ci/travis-install.sh
|
||||
before_script:
|
||||
- ./tools/ci/travis-before-script.sh
|
||||
script:
|
||||
- ./tools/ci/travis-script.sh
|
||||
after_success:
|
||||
- cpp-coveralls -i src -i include --exclude-pattern "/usr/*" --dump cpp_cov.json
|
||||
- coveralls --merge=cpp_cov.json
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# OpenMC Monte Carlo Particle Transport Code
|
||||
|
||||
[](http://openmc.readthedocs.io/en/latest/license.html)
|
||||
[](https://travis-ci.org/openmc-dev/openmc)
|
||||
[](https://github.com/openmc-dev/openmc/actions)
|
||||
[](https://coveralls.io/github/openmc-dev/openmc?branch=develop)
|
||||
|
||||
The OpenMC project aims to provide a fully-featured Monte Carlo particle
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include "openmc/capi.h"
|
||||
#include "openmc/cell.h"
|
||||
#include "openmc/geometry.h"
|
||||
#include "openmc/message_passing.h"
|
||||
#include "openmc/summary.h"
|
||||
#include "openmc/tallies/filter.h"
|
||||
#include "openmc/tallies/filter_cell.h"
|
||||
|
|
@ -48,7 +49,11 @@ int main(int argc, char** argv) {
|
|||
// the summary file will be used to check that
|
||||
// temperatures were set correctly so clear
|
||||
// error output can be provided
|
||||
#ifdef OPENMC_MPI
|
||||
if (openmc::mpi::master) openmc::write_summary();
|
||||
#else
|
||||
openmc::write_summary();
|
||||
#endif
|
||||
|
||||
openmc_run();
|
||||
openmc_finalize();
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ def install(omp=False, mpi=False, phdf5=False, dagmc=False):
|
|||
|
||||
if dagmc:
|
||||
cmake_cmd.append('-Ddagmc=ON')
|
||||
cmake_cmd.append('-DCMAKE_PREFIX_PATH=~/DAGMC')
|
||||
|
||||
# Build in coverage mode for coverage testing
|
||||
cmake_cmd.append('-Dcoverage=on')
|
||||
|
|
@ -1,31 +1,31 @@
|
|||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
# Install NJOY 2016
|
||||
./tools/ci/travis-install-njoy.sh
|
||||
|
||||
# Install DAGMC if needed
|
||||
if [[ $DAGMC = 'y' ]]; then
|
||||
./tools/ci/travis-install-dagmc.sh
|
||||
fi
|
||||
|
||||
# Install vectfit for WMP generation if needed
|
||||
if [[ $VECTFIT = 'y' ]]; then
|
||||
./tools/ci/travis-install-vectfit.sh
|
||||
fi
|
||||
|
||||
# Upgrade pip, pytest, numpy before doing anything else
|
||||
pip install --upgrade pip
|
||||
pip install --upgrade pytest
|
||||
pip install --upgrade numpy
|
||||
|
||||
# Install NJOY 2016
|
||||
./tools/ci/gha-install-njoy.sh
|
||||
|
||||
# Install DAGMC if needed
|
||||
if [[ $DAGMC = 'y' ]]; then
|
||||
./tools/ci/gha-install-dagmc.sh
|
||||
fi
|
||||
|
||||
# Install vectfit for WMP generation if needed
|
||||
if [[ $VECTFIT = 'y' ]]; then
|
||||
./tools/ci/gha-install-vectfit.sh
|
||||
fi
|
||||
|
||||
# Install mpi4py for MPI configurations
|
||||
if [[ $MPI == 'y' ]]; then
|
||||
pip install --no-binary=mpi4py mpi4py
|
||||
fi
|
||||
|
||||
# Build and install OpenMC executable
|
||||
python tools/ci/travis-install.py
|
||||
python tools/ci/gha-install.py
|
||||
|
||||
# Install Python API in editable mode
|
||||
pip install -e .[test,vtk]
|
||||
Loading…
Add table
Add a link
Reference in a new issue