-
Notifications
You must be signed in to change notification settings - Fork 264
66 lines (58 loc) · 2.12 KB
/
test.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
name: tests
on:
workflow_call:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]
merge_group:
jobs:
test:
runs-on: ubuntu-latest # TODO add macos tests too
strategy:
max-parallel: 10
matrix:
python_version: ['3.9', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install core dependencies and package
run: |
python -m pip install --upgrade pip
if [ -f packages/requirements.txt ]; then pip install -r packages/requirements.txt; fi
if [ -f packages/requirements-optional.txt ]; then pip install -r packages/requirements-optional.txt; fi
pip install -e packages/fairchem-core[dev]
pip install -e packages/fairchem-data-oc[dev]
pip install -e packages/fairchem-demo-ocpapi[dev]
pip install -e packages/fairchem-applications-cattsunami
- name: Install additional dependencies
run: |
wget https://github.com/m3g/packmol/archive/refs/tags/v20.15.0.tar.gz
tar -xzvf v20.15.0.tar.gz
cd packmol-20.15.0
./configure
make
echo "$(readlink -f .)" >> $GITHUB_PATH
- name: Test core with pytest
run: |
pytest tests -vv --ignore=tests/demo/ocpapi/tests/integration/ --cov-report=xml --cov=fairchem -c ./packages/fairchem-core/pyproject.toml
- if: ${{ matrix.python_version == '3.12' }}
name: codecov-report
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: false # optional (default = false)
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)