-
-
Notifications
You must be signed in to change notification settings - Fork 73
109 lines (97 loc) · 4.29 KB
/
test.yml
File metadata and controls
109 lines (97 loc) · 4.29 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# This workflow will install Python dependencies, run tests, and report the coverage with a variety of Python versions and OSs.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: test
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# * is a special character in YAML, so you have to quote this string
- cron: "0 0 * * *" # every midnight
jobs:
test:
name: Test (${{ matrix.os }}, python version ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"] # list of Python versions to test
# exclude:
# - os: windows-latest
# python-version: "3.10"
include:
- os: ubuntu-latest
path: ~/.cache/pip
# - os: windows-latest
# path: ~\AppData\Local\pip\Cache
steps:
- uses: actions/checkout@v4
- name: Set up Python using Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
miniconda-version: latest
- name: Cache pip dependencies
id: cache_pip
uses: actions/cache@v4
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-python${{ matrix.python-version }}-pip-20250302-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-python${{ matrix.python-version }}-pip-20250302-
# We have used a softer matching strategy for the full hash of setup.py, as recommended by GitHub.
# See: https://github.com/davronaliyev/Cache-dependencies-in-GitHub-Actions/blob/main/examples.md#python---pip
# This restores the cache first and then downloads any changed packages to avoid updating the cache with
# every change to the setup.py file, thus reducing the storage requirements of GitHub Action.
# We set a date tag to the cache key to show the updated date of the cache. We can update this date tag to
# generate new cache after every major changes in setup.py.
- name: Install PyTorch + PyG
run: |
pip install rdkit
pip install gdown
pip install pyparsing==3.2.0
pip install numpy>=2.0.0
pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cpu
pip install torch_scatter==2.1.2 -f https://data.pyg.org/whl/torch-2.6.0+cpu.html
pip install torch_sparse==0.6.18 -f https://data.pyg.org/whl/torch-2.6.0+cpu.html
pip install torch_cluster==1.6.3 -f https://data.pyg.org/whl/torch-2.6.0+cpu.html
pip install torch_spline_conv==1.2.2 -f https://data.pyg.org/whl/torch-2.6.0+cpu.html
pip install torch_geometric==2.6.0
shell: bash -l {0}
- name: Install project and dev dependencies
run: |
pip install --no-build-isolation -e .[dev]
shell: bash -l {0}
- name: Cache downloaded test data
id: cache_data
uses: actions/cache@v4
with:
path: tests/test_data
key: ${{ runner.os }}-python${{ matrix.python-version }}-data-${{ hashFiles('tests/download_test_data.py') }}
restore-keys: |
${{ runner.os }}-python${{ matrix.python-version }}-data-${{ hashFiles('tests/download_test_data.py') }}
# Use strict matching for the hash of download_test_data.py, as we want to update the cache whenever the file changes.
- name: Download test data
if: steps.cache_data.outputs.cache-hit != 'true'
run: |
python tests/download_test_data.py
shell: bash -l {0}
- name: Run tests with thread limits
id: run_tests
run: |
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
export NUMEXPR_NUM_THREADS=1
pytest --nbmake --nbmake-timeout=3000 --cov=kale
shell: bash -l {0}
- name: Determine coverage
run: |
coverage xml
shell: bash -l {0}
- name: Report coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}