Remove imports without "only" #111
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
env: | |
CI: "ON" | |
HOMEBREW_NO_ANALYTICS: "ON" | |
HOMEBREW_NO_AUTO_UPDATE: "ON" | |
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON" | |
HOMEBREW_NO_GITHUB_API: "ON" | |
HOMEBREW_NO_INSTALL_CLEANUP: "ON" | |
BUILD_DIR: _build | |
INSTALL_DIR: _install | |
CMAKE_OPTIONS: >- | |
-DWITH_API=true | |
-DWITH_SDFTD3=true | |
-DWITH_TBLITE=true | |
-DWITH_MBD=true | |
-DWITH_TRANSPORT=true | |
-DFYPP_FLAGS='-n;-DTRAVIS' | |
-DWITH_UNIT_TESTS=true | |
-DWITH_CHIMES=true | |
-DWITH_PYTHON=true | |
jobs: | |
gcc-build: | |
runs-on: ${{ matrix.os }} | |
env: | |
FC: gfortran | |
CC: gcc | |
CXX: g++ | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
mpi: [nompi, openmpi] | |
config: [Debug] | |
version: [13] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install GCC (Linux) | |
run: | | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get install -y gcc-${{ matrix.version}} gfortran-${{ matrix.version }} g++-${{ matrix.version }} | |
sudo update-alternatives \ | |
--install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.version }} 100 \ | |
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.version }} \ | |
--slave /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.version }} \ | |
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ matrix.version }} | |
- name: Enable MPI build | |
if: contains(matrix.mpi, 'openmpi') || contains(matrix.mpi, 'mpich') | |
run: echo "WITH_MPI=true" >> $GITHUB_ENV | |
- name: Disable MPI build | |
if: contains(matrix.mpi, 'nompi') | |
run: echo "WITH_MPI=false" >> $GITHUB_ENV | |
- name: Set Compiler | |
run: | | |
echo "FC=${FC}" >> ${GITHUB_ENV} | |
echo "CC=${CC}" >> ${GITHUB_ENV} | |
echo "CXX=${CXX}" >> ${GITHUB_ENV} | |
- name: Check submodule commits | |
run: ./utils/test/check_submodule_commits | |
- name: Install ARPACK | |
if: contains(matrix.mpi, 'nompi') | |
run: | | |
sudo apt-get install libarpack2-dev | |
echo "CMAKE_OPTIONS=${CMAKE_OPTIONS} -DWITH_ARPACK=true" >> $GITHUB_ENV | |
- name: Install OpenMPI | |
if: contains(matrix.mpi, 'openmpi') | |
run: | | |
sudo apt-get update | |
sudo apt-get install libopenmpi-dev libscalapack-openmpi-dev | |
echo "CMAKE_OPTIONS=${CMAKE_OPTIONS} -DSCALAPACK_LIBRARY='scalapack-openmpi'" >> $GITHUB_ENV | |
echo "CMAKE_DEP_OPTIONS=-DSCALAPACK_LIBRARY='scalapack-openmpi'" >> $GITHUB_ENV | |
- name: Install MPICH | |
if: contains(matrix.mpi, 'mpich') | |
run: | | |
sudo apt-get update | |
sudo apt-get install mpich libscalapack-mpich-dev | |
echo "CMAKE_OPTIONS=${CMAKE_OPTIONS} -DSCALAPACK_LIBRARY='scalapack-mpich'" >> $GITHUB_ENV | |
echo "CMAKE_DEP_OPTIONS=-DSCALAPACK_LIBRARY='scalapack-mpich'" >> $GITHUB_ENV | |
- name: Install requirements (pip) | |
run: pip3 install cmake ninja fypp numpy | |
- name: Get external dependencies | |
run: echo "y" | ./utils/get_opt_externals ALL | |
- name: Set extra CMake flags | |
run: | | |
echo "CMAKE_OPTIONS=${CMAKE_OPTIONS} -DENABLE_DYNAMIC_LOADING=true" >> $GITHUB_ENV | |
if [[ "${{ matrix.mpi }}" == "openmpi" || "${{ matrix.mpi }}" == "mpich" ]]; then | |
echo "CMAKE_OPTIONS=${CMAKE_OPTIONS} -DTEST_MPI_PROCS=2" >> $GITHUB_ENV | |
fi | |
- name: Configure build | |
run: >- | |
cmake -B ${BUILD_DIR} -G Ninja | |
-DCMAKE_INSTALL_PREFIX=${PWD}/${INSTALL_DIR} | |
-DCMAKE_BUILD_TYPE=${{ matrix.config }} | |
${CMAKE_OPTIONS} | |
-DWITH_MPI=${WITH_MPI} | |
- name: Build project | |
run: cmake --build ${BUILD_DIR} -j | |
- name: Run regression tests | |
run: | | |
if [[ "${{ matrix.mpi }}" == "nompi" ]]; then | |
echo "TEST_OMP_PROCS=4" >> $GITHUB_ENV | |
else | |
echo "TEST_OMP_PROCS=2" >> $GITHUB_ENV | |
fi | |
echo "TEST_UUID=$(uuidgen)" >> ${GITHUB_ENV} | |
ctest -j ${TEST_OMP_PROCS} --output-on-failure --test-dir ${BUILD_DIR} | |
- name: Archive any failed test output | |
if: failure() | |
run: | | |
./utils/test/collect_failed_output.sh ${BUILD_DIR} ${BUILD_DIR}/failed-tests.${TEST_UUID}.tar | |
- name: Upload the archive of failed test output | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: failed-tests.${{ env.TEST_UUID }}.tar | |
path: ${{ env.BUILD_DIR }}/failed-tests.${{ env.TEST_UUID }}.tar | |
retention-days: 2 | |
- name: Install project | |
run: cmake --install ${BUILD_DIR} | |
- name: Create gcov reports | |
if: contains(matrix.config, 'Coverage') | |
run: ./utils/test/make_gcov_reports ${PWD} ${PWD}/${BUILD_DIR}/gcovs ${PWD}/${BUILD_DIR}/src ${PWD}/${BUILD_DIR}/app | |
- name: Run integration CMake test | |
run: >- | |
CMAKE_PREFIX_PATH="${PWD}/${INSTALL_DIR}:${CMAKE_PREFIX_PATH}" | |
./test/src/dftbp/integration/cmake/runtest.sh ${BUILD_DIR}_cmake | |
${CMAKE_DEP_OPTIONS} | |
- name: Run integration pkg-config test | |
run: >- | |
PKG_CONFIG_PATH="${PWD}/${INSTALL_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH}" | |
./test/src/dftbp/integration/pkgconfig/runtest.sh ${BUILD_DIR}_pkgconfig | |
intel-build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
config: [RelWithDebInfo] | |
runs-on: ${{ matrix.os }} | |
env: | |
FC: ifx | |
CC: icx | |
WITH_MPI: false | |
CMAKE_OPTIONS: >- | |
-DCMAKE_BUILD_TYPE=${{ matrix.config }} | |
-DWITH_API=true | |
-DWITH_SDFTD3=true | |
-DWITH_MBD=true | |
-DWITH_TRANSPORT=true | |
-DFYPP_FLAGS='-DTRAVIS' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Setup Intel compiler | |
uses: rscohn2/setup-oneapi@v0 | |
with: | |
components: | | |
icx@2025.0.0 | |
ifx@2025.0.0 | |
mkl@2025.0.0 | |
- name: Setup Intel environment | |
run: | | |
source /opt/intel/oneapi/setvars.sh | |
printenv >> ${GITHUB_ENV} | |
echo "FC=${FC}" >> ${GITHUB_ENV} | |
echo "CC=${CC}" >> ${GITHUB_ENV} | |
- name: Install requirements (pip) | |
run: pip3 install cmake ninja fypp numpy | |
- name: Get external dependencies | |
run: echo "y" | ./utils/get_opt_externals ALL | |
- name: Set extra CMake flags | |
run: echo "CMAKE_OPTIONS=${CMAKE_OPTIONS} -DBUILD_SHARED_LIBS=true -DENABLE_DYNAMIC_LOADING=true" >> $GITHUB_ENV | |
- name: Configure build | |
run: >- | |
cmake -B ${BUILD_DIR} -G Ninja | |
-DCMAKE_INSTALL_PREFIX=${PWD}/${INSTALL_DIR} | |
${CMAKE_OPTIONS} | |
-DWITH_MPI=${WITH_MPI} | |
- name: Build project | |
run: cmake --build ${BUILD_DIR} -j | |
- name: Run regression tests | |
run: | | |
pushd ${BUILD_DIR} | |
ctest -j --output-on-failure | |
popd |