-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (46 loc) · 1.54 KB
/
pythonpackage.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
name: tests
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 12
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, "3.10"]
torch-version: [11, 12, 13]
exclude:
- os: macos-latest
python-version: "3.10"
torch-version: 11
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -r tests/requirements.txt
python -m pip install -U torch==1.${{ matrix.torch-version }} torchaudio==0.${{ matrix.torch-version }}
- name: Test and coverage with pytest
run: |
pip install pytest
python -m pip freeze | grep torch
pytest --cov=./torchiva --cov-report=xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
- name: Create and check dist
run: |
pip install -U setuptools wheel twine
python setup.py sdist
twine check dist/*
- name: Publish sdist to pypi
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --skip-existing dist/*