-
-
Notifications
You must be signed in to change notification settings - Fork 51
73 lines (69 loc) · 2.72 KB
/
workflows.yaml
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
name: Python package
on: [push]
jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
torch-version: [2.0.0, 2.1.0, 2.2.0]
include:
- torch-version: 2.1.0
torchvision-version: 0.16.0
- torch-version: 2.0.0
torchvision-version: 0.15.1
- torch-version: 2.2.0
torchvision-version: 0.17.0
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install PyTorch ${{ matrix.torch-version }}+cpu
run: |
pip install torch==${{ matrix.torch-version}}+cpu torchvision==${{ matrix.torchvision-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install internal dependencies
run: |
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-${{ matrix.torch-version}}+cpu.html
- name: Install main package
run: |
pip install -e .
pip install pytest-xdist
- name: Setup with pytest-xdist
run: |
# lets get the string for how many cpus to use with pytest
echo "Will be using ${{ inputs.pytest_numcpus }} cpus for pytest testing"
#
# make PYTESTXDIST
export PYTESTXDIST="-n 2"
if [ 2 -gt 0 ]; then export PYTESTXDIST="$PYTESTXDIST --dist=loadfile"; fi
#
# echo results and save env var for other jobs
echo "pytest-xdist options that will be used are: $PYTESTXDIST"
echo "PYTESTXDIST=$PYTESTXDIST" >> $GITHUB_ENV
- name: Setup with pytest-cov
run: |
# let make pytest run with coverage
echo "Will be looking at coverage of dir graph_weather"
#
# install pytest-cov
pip install coverage==6.2 # https://github.com/nedbat/coveragepy/issues/1312
pip install pytest-cov
#
# make PYTESTCOV
export PYTESTCOV="--cov=graph_weather--cov-report=xml"
# echo results and save env var for other jobs
echo "pytest-cov options that will be used are: $PYTESTCOV"
echo "PYTESTCOV=$PYTESTCOV" >> $GITHUB_ENV
- name: Run pytest
run: |
export PYTEST_COMMAND="pytest $PYTESTCOV $PYTESTXDIST -s"
echo "Will be running this command: $PYTEST_COMMAND"
eval $PYTEST_COMMAND
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false