-
-
Notifications
You must be signed in to change notification settings - Fork 120
89 lines (77 loc) · 3.53 KB
/
testing_ci.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
81
82
83
84
85
86
87
88
89
name: CI
on:
push:
branches:
- main
- dev
- temp_test_branch # if in need, create such a temporary branch to test some functions
pull_request:
branches:
- dev
jobs:
CI-testing:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ["3.8", "3.11"]
pytorch-version: ["2.3.0"]
steps:
- name: Check out the repo code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
check-latest: true
cache: pip
cache-dependency-path: |
requirements/requirements.txt
requirements/requirements_dev.txt
- name: Install PyTorch ${{ matrix.pytorch-version }}+cpu
# we have to install torch in advance because torch_sparse needs it for compilation,
# refer to https://github.com/rusty1s/pytorch_sparse/issues/156#issuecomment-1304869772 for details
run: |
which python
which pip
pip install torch==${{ matrix.pytorch-version }} -f https://download.pytorch.org/whl/cpu
python -c "import torch; print('PyTorch:', torch.__version__)"
- name: Install other dependencies
run: |
pip install -r requirements/requirements.txt
pip install numpy==1.24 # many libs not compatible with numpy 2.0. Note 3.12 requests for numpy>=2.0
pip install pandas==1.5 # fix pandas version to avoid installing pandas 2.0, the same reason with numpy
- name: Test building package
# we need to know if the package can be built successfully without optional dependencies
run: |
pip install build wheel
python -m build
- name: Continue to install torch-geometric dependencies
run: |
pip install torch-geometric torch-scatter torch-sparse -f "https://data.pyg.org/whl/torch-${{ matrix.pytorch-version }}+cpu.html"
pip install pypots[dev]
python_site_path=`python -c "import site; print(site.getsitepackages()[0])"`
echo "python site-packages path: $python_site_path"
rm -rf $python_site_path/pypots
python -c "import shutil;import site;shutil.copytree('pypots',site.getsitepackages()[0]+'/pypots')"
- name: Fetch the test environment details
run: |
which python
pip list
- name: Test with pytest
run: |
rm -rf testing_results && rm -rf tests/__pycache__ && rm -rf tests/*/__pycache__
python tests/global_test_config.py
python -m pytest -rA tests/*/* -s -n auto --cov=pypots --dist=loadgroup --cov-config=.coveragerc
- name: Generate the LCOV report
run: |
python -m coverage lcov
- name: Submit the report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "coverage.lcov"