-
Notifications
You must be signed in to change notification settings - Fork 19
80 lines (65 loc) · 2.17 KB
/
testing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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
if: matrix.os == 'macos-latest'
shell: bash -el {0}
run: |
cd tests
pytest
- name: Run tests
if: matrix.os == 'ubuntu-latest'
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