diff --git a/.github/workflows/changelog_test.yml b/.github/workflows/changelog_test.yml new file mode 100644 index 0000000..20e33c4 --- /dev/null +++ b/.github/workflows/changelog_test.yml @@ -0,0 +1,38 @@ +name: Changelog update check + +on: + # allows us to run workflows manually + workflow_dispatch: + pull_request: + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + check_changelog_update: + runs-on: ubuntu-latest + container: + image: alpine:3.14 + + name: Check if Changelog has been updated + steps: + - name: Install latest git + run: | + apk add --no-cache bash git openssh + git --version + + - name: Checkout repository + uses: actions/checkout@v4 + + - run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} + cd $GITHUB_WORKSPACE + git remote add arfc https://github.com/arfc/openmcyclus.git + git fetch arfc + change=`git diff arfc/main -- CHANGELOG.rst | wc -l` + git remote remove arfc + if [ $change -eq 0 ]; then + echo "CHANGELOG.rst has not been updated" + exit 1 + fi + diff --git a/.github/workflows/test-openmcyclus.yml b/.github/workflows/test-openmcyclus.yml index fdcbd3b..d35c567 100644 --- a/.github/workflows/test-openmcyclus.yml +++ b/.github/workflows/test-openmcyclus.yml @@ -1,11 +1,9 @@ name: test-openmcyclus -on: [pull_request] +on: [pull_request, push] jobs: - build-and-test: + integration-tests: runs-on: ubuntu-latest - container: - image: cyclus/cycamore defaults: run: shell: bash -l {0} @@ -18,35 +16,25 @@ jobs: miniforge-variant: Mambaforge miniforge-version: latest activate-environment: openmcyclus-env - environment-file: environment.yml use-mamba: true - name: Conda config run: | conda config --env --set pip_interop_enabled True - - name: Update Environment + - name: Install dependencies run: | - pip install pytest - mamba env update -n openmcyclus-env -f environment.yml + mamba install -y cycamore openmc scipy=1.11 pytest - name: Install OpenMC cross section library - run: $GITHUB_WORKSPACE/openmc-xs.bash - - - name: Install OpenMC from Mamba - run: mamba install openmc - - - name: Install OpenMC cross section library - run: echo "OPENMC_CROSS_SECTIONS=cross_sections.xml" >> $GITHUB_ENV + run: | + $GITHUB_WORKSPACE/openmc-xs.bash + echo "OPENMC_CROSS_SECTIONS=cross_sections.xml" >> $GITHUB_ENV - name: Install OpenMCyclus run: | pip install . -# - name: Check environment -# run: | -# pip install pytest - # - name: Run Tests # run: | # pytest tests/integration_tests/test_depletereactor.py diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 3a9e8f3..86ed0d0 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -2,7 +2,7 @@ name: unit-tests on: [pull_request, push] jobs: - build-and-unit-test: + unit-test: runs-on: ubuntu-latest defaults: run: @@ -16,7 +16,6 @@ jobs: miniforge-variant: Mambaforge miniforge-version: latest activate-environment: openmcyclus-env - environment-file: environment.yml use-mamba: true - name: Conda config @@ -25,7 +24,7 @@ jobs: - name: Install OpenMC from Mamba run: - mamba install openmc scipy=1.11 + mamba install openmc scipy=1.11 pytest - name: Install OpenMC cross section library run: | diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8fda6d3..e3b0987 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,15 +13,21 @@ Since last release: * Add input parameters to `DepleteReactor` for the thermal power (instead of just using `power_cap`) and flux (required input for running OpenMC with new version) (#18) +* Add CI test to check if CHANGELOG has been updated (#21) **Changed:** * Change OpenMC dependency to v0.14.0, which includes adding parameters for using `DepleteReactor` (#18) +* Simplify CI build environment, using conda builds instead of + building from source (#21) + **Removed:** * Remove `check_existing_recipes` method in `DepleteReactor` (#18) +* Remove various files in repo that are no longer used for building + CI environment (#21) **Fixed:** diff --git a/build-cyclus.sh b/build-cyclus.sh deleted file mode 100755 index 0cd819c..0000000 --- a/build-cyclus.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# Build cyclus -cd cyclus -conda activate openmcyclus-env -python install.py -cd ../ \ No newline at end of file diff --git a/build-openmc.sh b/build-openmc.sh deleted file mode 100755 index da52fc9..0000000 --- a/build-openmc.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -ex - -# Build openmc -cd openmc -./tools/ci/gha-install-mcpl.sh -python tools/ci/gha-install.py - -# Install the OpenMC python API -pip install . -cd ../ diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 8faf219..0000000 --- a/environment.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: openmcyclus-env -channels: - - conda-forge - - defaults -dependencies: - - openssh - - pytest - - gxx_linux-64==12.2 - - gcc_linux-64==12.2 - - cmake - - make - - docker-pycreds - - git - - xo - - python-json-logger - - glib - - libxml2 - - libxmlpp - - libblas - - libcblas - - liblapack - - pkg-config - - coincbc - - boost-cpp - - sqlite - - pcre - - gettext - - bzip2 - - xz - - setuptools - - pytables - - pandas - - jinja2 - - cython - - websockets - - pprintpp - - hdf5==1.12.2 - - notebook - - nb_conda_kernels - - requests - - entrypoints - - pyyaml - - vtk - - coverage - - pytest-cov - - colorama - - libpng - - uncertainties - - lxml - - scipy diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 10f3f59..0000000 --- a/requirements.txt +++ /dev/null @@ -1,45 +0,0 @@ -pytest -openssh -gxx_linux-64==12.2 -gcc_linux-64==12.2 -cmake -make -docker-pycreds -git -xo -python-json-logger -glib -libxml2 -libxmlpp -libblas -libcblas -liblapack -pkg-config -coincbc -boost-cpp -sqlite -pcre -gettext -bzip2 -xz -setuptools -pytables -pandas -jinja2 -cython -websockets -pprintpp -hdf5==1.12.2 -notebook -nb_conda_kernels -requests -entrypoints -pyyaml -vtk -coverage -pytest-cov -colorama -libpng -uncertainties -lxml -scipy \ No newline at end of file diff --git a/tests/unit_tests/test_depletion.py b/tests/unit_tests/test_depletion.py index 7917703..0c083fc 100644 --- a/tests/unit_tests/test_depletion.py +++ b/tests/unit_tests/test_depletion.py @@ -19,7 +19,8 @@ def setUp(self): 10, 100e-6, "./examples/") - self.materials = openmc.Materials().from_xml("./examples/materials.xml") + self.materials = openmc.Materials().from_xml( + "./examples/materials.xml") self.micro_xs = od.MicroXS.from_csv("./examples/micro_xs.csv") def run_depletion(self, flux): @@ -66,11 +67,11 @@ def test_update_materials(self): openmc.material.NuclideTuple('U235', 0.05, 'wo'), openmc.material.NuclideTuple('U238', 0.95, 'wo')] assert materials[1].nuclides == [ - openmc.material.NuclideTuple('Cs137', 0.1, 'wo'), - openmc.material.NuclideTuple('Kr85', 0.80, 'wo'), + openmc.material.NuclideTuple('Cs137', 0.1, 'wo'), + openmc.material.NuclideTuple('Kr85', 0.80, 'wo'), openmc.material.NuclideTuple('Xe135', 0.10, 'wo')] assert materials[2].nuclides == [ - openmc.material.NuclideTuple('Pu239', 0.10, 'wo'), + openmc.material.NuclideTuple('Pu239', 0.10, 'wo'), openmc.material.NuclideTuple('Pu241', 0.90, 'wo')] assert material_ids == [5, 6, 7] @@ -96,5 +97,7 @@ def test_get_spent_comps(self): assert 551370000 in spent_comps[0].keys() assert 922350000 in spent_comps[0].keys() assert 932410000 not in spent_comps[0].keys() - assert spent_comps[0][922350000] == 10.650004036820036 - assert spent_comps[0][942390000] == 0.22663550016678385 + assert spent_comps[0][922350000] == pytest.approx( + 10.650004036820036, rel=1e-5) + assert spent_comps[0][942390000] == pytest.approx( + 0.22663550016678385, rel=1e-5)