| 1 |
name: Testing |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
pull_request: |
| 8 |
|
| 9 |
jobs: |
| 10 |
|
| 11 |
pytest: |
| 12 |
runs-on: ${{ matrix.os }} |
| 13 |
|
| 14 |
strategy: |
| 15 |
fail-fast: false |
| 16 |
matrix: |
| 17 |
os: [ubuntu-latest, windows-latest] |
| 18 |
python-version: [3.8] |
| 19 |
torch-version: [2.0.0, 2.1.0] |
| 20 |
|
| 21 |
steps: |
| 22 |
- uses: actions/checkout@v2 |
| 23 |
- name: Set up Python ${{ matrix.python-version }} |
| 24 |
uses: actions/setup-python@v2 |
| 25 |
with: |
| 26 |
python-version: ${{ matrix.python-version }} |
| 27 |
|
| 28 |
- name: Install PyTorch ${{ matrix.torch-version }} |
| 29 |
run: | |
| 30 |
pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu |
| 31 |
|
| 32 |
- name: Patch PyTorch static constexpr on Windows |
| 33 |
if: ${{ runner.os == 'Windows' }} |
| 34 |
run: | |
| 35 |
Torch_DIR=`python -c 'import os; import torch; print(os.path.dirname(torch.__file__))'` |
| 36 |
sed -i '31,38c\ |
| 37 |
TORCH_API void lazy_init_num_threads();' ${Torch_DIR}/include/ATen/Parallel.h |
| 38 |
shell: bash |
| 39 |
|
| 40 |
- name: Install main package |
| 41 |
run: | |
| 42 |
python setup.py develop |
| 43 |
|
| 44 |
- name: Run test-suite |
| 45 |
run: | |
| 46 |
pip install pytest pytest-cov |
| 47 |
pytest --cov --cov-report=xml |
| 48 |
|
| 49 |
- name: Upload coverage |
| 50 |
uses: codecov/codecov-action@v1 |
| 51 |
if: success() |
| 52 |
with: |
| 53 |
fail_ci_if_error: false |