conv_tol crossref, remove PCM cavity files #699
Workflow file for this run
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: | |
branches: [master] | |
pull_request: | |
schedule: | |
- cron: '0 4 * * 6' # Run every Sunday | |
jobs: | |
# | |
# Unit tests | |
# | |
test: | |
name: Python ${{ matrix.version }} - ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- {version: '3.11', os: ubuntu-latest, documentation: True} | |
- {version: '3.9', os: ubuntu-latest, documentation: False} | |
- {version: '3.11', os: macos-13 , documentation: False} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.version }} | |
- uses: actions/cache@v4 | |
env: | |
cache-name: cache-artifacts | |
with: | |
path: | | |
~/.ccache | |
~/.cache/pip | |
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/setup.py') }} | |
restore-keys: | | |
${{ runner.os }}-test-${{ env.cache-name }}- | |
${{ runner.os }}-test- | |
${{ runner.os }}- | |
- name: Install system dependencies on Linux | |
run: sudo apt-get install libopenblas-base ccache doxygen lcov | |
if: contains( matrix.os, 'ubuntu') | |
- name: Install system dependencies on macOS | |
run: brew install ccache doxygen lcov | |
if: contains( matrix.os, 'macos') | |
# | |
- name: Dump siteconfig with coverage flags for C++ | |
run: | | |
mkdir $HOME/.adcc/ | |
echo 'coverage = True' > $HOME/.adcc/siteconfig.py | |
- name: Hard-code download url for MacOS | |
run: | | |
echo "libtensor_url = \"$BASE_URL/$VERSION_URL\"" >> $HOME/.adcc/siteconfig.py | |
env: | |
BASE_URL: https://github.com/adc-connect/libtensor/releases/download | |
VERSION_URL: v3.0.1/libtensorlight-3.0.1-macosx_10_15_x86_64.tar.gz | |
if: contains( matrix.os, 'macos') | |
- name: Install python dependencies | |
run: | | |
export PATH="/usr/local/opt/ccache/libexec:$PATH" | |
export PATH="/usr/lib/ccache:$PATH" | |
python -m pip install --user pyscf cppe wheel | |
# | |
- name: Install package | |
run: | | |
pip install --user .[tests] | |
- name: Run python tests with std allocator | |
run: | | |
python -m pytest adcc --cov=adcc | |
- name: Run reduced python tests with libxm | |
run: | | |
python -m pytest adcc --allocator=libxm -k "TestFunctionality and h2o_sto3g" | |
- name: Run C++ tests | |
run: python setup.py cpptest -v | |
# Documentation build | |
- name: Dependencies for documentation | |
run: python -m pip install --user .[build_docs] | |
if: matrix.documentation | |
- name: Build documentation | |
run: | | |
cd docs && doxygen && cd .. | |
sphinx-build -M html docs build/sphinx | |
if: matrix.documentation | |
- name: Upload documentation artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: build/sphinx/html | |
if: matrix.documentation | |
# | |
- name: Upload coverage to codecov | |
run: | | |
pip install codecov | |
codecov -X gcov | |
lcov --directory . --capture --output-file coverage.info | |
lcov --remove coverage.info '/opt/*' '/Applications/*' '/Library/*' '/usr/*' "${HOME}"'/.cache/*' "${HOME}"'/.local/*' "${PWD}"'/build/*' "${PWD}"'/libadcc/tests/*' --output-file coverage.info | |
lcov --list coverage.info | |
codecov -X gcov -f coverage.info | |
if: contains(matrix.os, 'ubuntu') | |
- name: Upload coverage to coveralls | |
# Note: Needs to be after the above step, because it parses the coverage.info | |
run: | | |
pip install coveralls | |
sudo gem install coveralls-lcov | |
coveralls-lcov -v -n coverage.info > coverage.json | |
coveralls --service=github --merge=coverage.json | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: contains(matrix.os, 'ubuntu') | |
deploy_documentation: | |
name: Deploy Documentation to Github Pages | |
if: github.ref == 'refs/heads/master' | |
needs: test | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
# Specify runner + deployment step | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
# | |
# Test Conda Python | |
# | |
test_conda: | |
name: Conda Python ${{ matrix.version }} - ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- {version: '3.11', os: ubuntu-latest, documentation: False} | |
- {version: '3.11', os: macos-13 , documentation: False} | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Patch compiler in Conda environment file | |
if: contains( matrix.os, 'macos') | |
run: | | |
sed -E -i.bak "s;gcc_linux-64;clang_osx-64;g" conda/environment.yml | |
sed -E -i.bak "s;gxx_linux-64;clangxx_osx-64;g" conda/environment.yml | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: adcc-dev | |
environment-file: conda/environment.yml | |
miniforge-variant: Mambaforge | |
use-mamba: true | |
miniforge-version: latest | |
python-version: ${{ matrix.version }} | |
auto-activate-base: false | |
# - name: Dump siteconfig with coverage flags for C++ | |
# run: | | |
# mkdir $HOME/.adcc/ | |
# echo 'coverage = True' > $HOME/.adcc/siteconfig.py | |
- name: Install Psi4 from c-f | |
run: | | |
mamba install psi4 pyddx -c conda-forge -c conda-forge/label/libint_dev | |
psi4 --version | |
python -c "import psi4" | |
- name: Build and test adcc | |
run: | | |
conda info | |
conda list | |
CXXFLAGS="$(echo $CXXFLAGS | sed 's/-fvisibility-inlines-hidden //g')" | |
pip install .[tests] --user | |
# NOTE: pcmsolver not 'linked' with Psi4 1.8 | |
pytest adcc -k "not pcm" | |
# python setup.py cpptest -v # TODO: currently doesn't compile... | |
# | |
# - name: Upload coverage to codecov | |
# run: | | |
# pip install codecov | |
# codecov -X gcov | |
# lcov --directory . --capture --output-file coverage.info | |
# lcov --remove coverage.info '/opt/*' '/Applications/*' '/Library/*' '/usr/*' "${HOME}"'/.cache/*' "${HOME}"'/.local/*' "${PWD}"'/build/*' "${PWD}"'/libadcc/tests/*' --output-file coverage.info | |
# lcov --list coverage.info | |
# codecov -X gcov -f coverage.info | |
# | |
# - name: Upload coverage to coveralls | |
# # Note: Needs to be after the above step, because it parses the coverage.info | |
# run: | | |
# pip install coveralls | |
# sudo gem install coveralls-lcov | |
# coveralls-lcov -v -n coverage.info > coverage.json | |
# coveralls --service=github --merge=coverage.json | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# | |
# Test source code formatting | |
# | |
formatting: | |
name: Code style | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
pip install flake8 | |
sudo apt-get install clang-format | |
- run: flake8 | |
- name: Checking C++ files with clang-format | |
working-directory: libadcc | |
run: | | |
clang-format --version | |
find . -type f \( -name '*.cc' -o -name '*.hh' \) -print0 | xargs -r0 clang-format -i | |
git diff --exit-code |