forked from tensorly/tensorly
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (61 loc) · 2.08 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
67
68
69
name: Test TensorLy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
BACKEND: ['numpy', 'pytorch']
python-version: ['3.12']
include:
- BACKEND: 'numpy'
python-version: '3.8'
- BACKEND: 'numpy'
python-version: '3.9'
TENSORLY_TENALG_BACKEND: ['einsum']
- BACKEND: 'jax'
python-version: '3.12'
TENSORLY_TENALG_BACKEND: ['einsum']
- BACKEND: 'tensorflow'
python-version: '3.12'
TENSORLY_TENALG_BACKEND: ['einsum']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: |
requirements.txt
- name: Install dependencies and backend ${{matrix.BACKEND}}
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r doc/requirements_doc.txt
echo "Installing dependencies for BACKEND=${{matrix.BACKEND}}"
if [[ "${{matrix.BACKEND}}" == "numpy" ]]; then
echo "Installing sparse";
pip install sparse;
elif [[ "${{matrix.BACKEND}}" == "pytorch" ]]; then
echo "Installing PyTorch";
pip install torch torchvision;
elif [[ "${{matrix.BACKEND}}" == "tensorflow" ]]; then
echo "Installing TensorFlow";
pip install tensorflow;
elif [[ "${{matrix.BACKEND}}" == "jax" ]]; then
echo "Installing JAX";
pip install jax jaxlib;
fi
- name: Install package
run: |
python -m pip install -e .
- name: Test with backend ${{matrix.BACKEND}} pytest and coverage
run: |
TENSORLY_BACKEND=${{matrix.BACKEND}} pytest -vv --cov tensorly --cov-report xml --durations=10 tensorly
- name: Check coverage with CodeCov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
verbose: true