2222
2323jobs :
2424 main :
25- runs-on : ubuntu-20 .04
25+ runs-on : ubuntu-22 .04
2626 strategy :
2727 matrix :
28- python-version : [3.8 ]
28+ python-version : ["3.11" ]
2929 mpi : [n, y]
3030 omp : [n, y]
3131 dagmc : [n]
@@ -34,30 +34,30 @@ jobs:
3434 vectfit : [n]
3535
3636 include :
37- - python-version : 3.6
37+ - python-version : " 3.12 "
3838 omp : n
3939 mpi : n
40- - python-version : 3.7
40+ - python-version : " 3.13 "
4141 omp : n
4242 mpi : n
4343 - dagmc : y
44- python-version : 3.8
44+ python-version : " 3.11 "
4545 mpi : y
4646 omp : y
4747 - libmesh : y
48- python-version : 3.8
48+ python-version : " 3.11 "
4949 mpi : y
5050 omp : y
5151 - libmesh : y
52- python-version : 3.8
52+ python-version : " 3.11 "
5353 mpi : n
5454 omp : y
5555 - event : y
56- python-version : 3.8
56+ python-version : " 3.11 "
5757 omp : y
5858 mpi : n
5959 - vectfit : y
60- python-version : 3.8
60+ python-version : " 3.11 "
6161 omp : n
6262 mpi : y
6363 name : " Python ${{ matrix.python-version }} (omp=${{ matrix.omp }},
@@ -73,62 +73,143 @@ jobs:
7373 EVENT : ${{ matrix.event }}
7474 VECTFIT : ${{ matrix.vectfit }}
7575 LIBMESH : ${{ matrix.libmesh }}
76+ NPY_DISABLE_CPU_FEATURES : " AVX512F AVX512_SKX"
77+ OPENBLAS_NUM_THREADS : 1
78+ PYTEST_ADDOPTS : --cov=openmc --cov-report=lcov:coverage-python.lcov
79+ # libfabric complains about fork() as a result of using Python multiprocessing.
80+ # We can work around it with RDMAV_FORK_SAFE=1 in libfabric < 1.13 and with
81+ # FI_EFA_FORK_SAFE=1 in more recent versions.
82+ RDMAV_FORK_SAFE : 1
7683
7784 steps :
78- - uses : actions/checkout@v2
85+ - name : Setup cmake
86+ uses : jwlawson/actions-setup-cmake@v2
87+ with :
88+ cmake-version : ' 3.31'
89+
90+ - name : Checkout repository
91+ uses : actions/checkout@v4
92+ with :
93+ fetch-depth : 0
7994
8095 - name : Set up Python ${{ matrix.python-version }}
81- uses : actions/setup-python@v2
96+ uses : actions/setup-python@v5
8297 with :
8398 python-version : ${{ matrix.python-version }}
8499
85100 - name : Environment Variables
86101 run : |
87- echo "DAGMC_ROOT=$HOME/DAGMC"
88102 echo "OPENMC_CROSS_SECTIONS=$HOME/nndc_hdf5/cross_sections.xml" >> $GITHUB_ENV
89103 echo "OPENMC_ENDF_DATA=$HOME/endf-b-vii.1" >> $GITHUB_ENV
104+ # get the sha of the last branch commit
105+ # for push and workflow_dispatch events, use the current reference head
106+ BRANCH_SHA=HEAD
107+ # for a pull_request event, use the last reference of the parents of the merge commit
108+ if [ "${{ github.event_name }}" == "pull_request" ]; then
109+ BRANCH_SHA=$(git rev-list --parents -n 1 HEAD | rev | cut -d" " -f 1 | rev)
110+ fi
111+ COMMIT_MESSAGE=$(git log $BRANCH_SHA -1 --pretty=%B | tr '\n' ' ')
112+ echo ${COMMIT_MESSAGE}
113+ echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV
90114
91115 - name : Apt dependencies
92116 shell : bash
93117 run : |
94118 sudo apt -y update
95119 sudo apt install -y libpng-dev \
96- libmpich-dev \
97120 libnetcdf-dev \
98121 libpnetcdf-dev \
99122 libhdf5-serial-dev \
100- libhdf5-mpich-dev \
101123 libeigen3-dev
124+
125+ - name : Optional apt dependencies for MPI
126+ shell : bash
127+ if : ${{ matrix.mpi == 'y' }}
128+ run : |
129+ sudo apt install -y libhdf5-mpich-dev \
130+ libmpich-dev
102131 sudo update-alternatives --set mpi /usr/bin/mpicc.mpich
103132 sudo update-alternatives --set mpirun /usr/bin/mpirun.mpich
104133 sudo update-alternatives --set mpi-x86_64-linux-gnu /usr/include/x86_64-linux-gnu/mpich
105134
135+ - name : Optional apt dependencies for vectfit
136+ shell : bash
137+ if : ${{ matrix.vectfit == 'y' }}
138+ run : sudo apt install -y libblas-dev liblapack-dev
139+
106140 - name : install
107141 shell : bash
108142 run : |
109143 echo "$HOME/NJOY2016/build" >> $GITHUB_PATH
110144 $GITHUB_WORKSPACE/tools/ci/gha-install.sh
111145
146+ - name : display-config
147+ shell : bash
148+ run : |
149+ openmc -v
150+
151+ - name : cache-xs
152+ uses : actions/cache@v4
153+ with :
154+ path : |
155+ ~/nndc_hdf5
156+ ~/endf-b-vii.1
157+ key : ${{ runner.os }}-build-xs-cache
158+
112159 - name : before
113160 shell : bash
114161 run : $GITHUB_WORKSPACE/tools/ci/gha-before-script.sh
115162
116163 - name : test
117164 shell : bash
118- run : $GITHUB_WORKSPACE/tools/ci/gha-script.sh
165+ run : |
166+ CTEST_OUTPUT_ON_FAILURE=1 make test -C $GITHUB_WORKSPACE/build/
167+ $GITHUB_WORKSPACE/tools/ci/gha-script.sh
168+
169+ - name : Setup tmate debug session
170+ continue-on-error : true
171+ if : ${{ contains(env.COMMIT_MESSAGE, '[gha-debug]') }}
172+ uses : mxschmitt/action-tmate@v3
173+ timeout-minutes : 10
174+
175+ - name : Generate C++ coverage (gcovr)
176+ shell : bash
177+ run : |
178+ # Produce LCOV directly from gcov data in the build tree
179+ gcovr \
180+ --root "$GITHUB_WORKSPACE" \
181+ --object-directory "$GITHUB_WORKSPACE/build" \
182+ --filter "$GITHUB_WORKSPACE/src" \
183+ --filter "$GITHUB_WORKSPACE/include" \
184+ --exclude "$GITHUB_WORKSPACE/src/external/.*" \
185+ --exclude "$GITHUB_WORKSPACE/src/include/openmc/external/.*" \
186+ --gcov-ignore-errors source_not_found \
187+ --gcov-ignore-errors output_error \
188+ --gcov-ignore-parse-errors suspicious_hits.warn \
189+ --print-summary \
190+ --lcov -o coverage-cpp.lcov || true
119191
120- - name : after_success
192+ - name : Merge C++ and Python coverage
121193 shell : bash
122194 run : |
123- cpp-coveralls -i src -i include --exclude-pattern "/usr/*" --dump cpp_cov.json
124- coveralls --merge=cpp_cov.json --service=github
195+ # Merge C++ and Python LCOV into a single file for upload
196+ cat coverage-cpp.lcov coverage-python.lcov > coverage.lcov
197+
198+ - name : Upload coverage to Coveralls
199+ if : ${{ hashFiles('coverage.lcov') != '' }}
200+ uses : coverallsapp/github-action@v2
201+ with :
202+ github-token : ${{ secrets.GITHUB_TOKEN }}
203+ parallel : true
204+ flag-name : C++ and Python
205+ path-to-lcov : coverage.lcov
125206
126207 finish :
127208 needs : main
128209 runs-on : ubuntu-latest
129210 steps :
130211 - name : Coveralls Finished
131- uses : coverallsapp/github-action@master
212+ uses : coverallsapp/github-action@v2
132213 with :
133- github-token : ${{ secrets.github_token }}
214+ github-token : ${{ secrets.GITHUB_TOKEN }}
134215 parallel-finished : true
0 commit comments