Kliff master v1 #495
Workflow file for this run
This file contains hidden or 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: Testing | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5.0.0 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pre-commit | |
pip install click>=8.0.0 | |
- name: Lint | |
run: pre-commit run --show-diff-on-failure --all-files | |
test: | |
strategy: | |
matrix: | |
#os: [ubuntu-latest, macos-latest] | |
os: [ubuntu-latest] | |
python-version: ["3.9","3.10","3.11"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up micromamba | |
uses: mamba-org/setup-micromamba@v1.8.0 | |
with: | |
# the create command looks like this: | |
# `micromamba create -n test-env python=<the corresponding version> kim-api=2.3.0` | |
environment-name: test-env | |
cache-environment: true | |
create-args: >- | |
python=${{ matrix.python-version }} | |
kim-api=2.3.0 | |
cmake<4.0.0 | |
ipcamit::libdescriptor=0.2.5 | |
- name: Install KIM model | |
shell: bash -el {0} | |
run: | | |
kim-api-collections-management install user SW_StillingerWeber_1985_Si__MO_405512056662_006 | |
- name: Install | |
shell: bash -el {0} | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install .[test] | |
# install torch dependencies | |
# Need to install torch manually as the install group cannot find torch | |
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu | |
python -m pip install .[torch] | |
# TODO, here, we install ptemcee from Yonatan's fork. See setup.py for details. | |
python -m pip uninstall --yes ptemcee | |
python -m pip install git+https://github.com/yonatank93/ptemcee.git@enhance_v1.0.0 | |
- name: Run tests | |
shell: bash -el {0} | |
run: | | |
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH | |
cd tests | |
pytest --cov=kliff --cov-report=xml | |
- uses: codecov/codecov-action@v4 | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' && github.repository == 'openkim/kliff' | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml |