Merge pull request #166 from openkim/dependabot/github_actions/mamba-… #420
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: Testing | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pre-commit | |
- name: Lint | |
run: pre-commit run --show-diff-on-failure --all-files | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: ["3.8", "3.9", "3.10"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up micromamba | |
uses: mamba-org/[email protected] | |
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 | |
kimpy=2.1.1 | |
- 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] | |
# 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: | | |
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 |