Skip to content

Install Pytorch CPU version for CI pipeline #417

Install Pytorch CPU version for CI pipeline

Install Pytorch CPU version for CI pipeline #417

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
multitest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022]
python-version: ["3.7", "3.9", "3.11"]
steps:
- uses: actions/checkout@v2
- if: matrix.os == 'ubuntu-latest'
name: install audio library libsndfile
run: sudo apt-get -y update && sudo apt-get install -y libsndfile1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: |
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
pip install -r test/requirements.txt
pip install .
- name: Test with pytest
run: pytest test
env:
CI: true
coverage:
needs: multitest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install audio library libsndfile
run: sudo apt-get -y update && sudo apt-get install -y libsndfile1
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Generate coverage report
run: |
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
pip install -r test/requirements.txt
pip install .
coverage run -m pytest test
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
documentation:
needs: multitest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install audio library libsndfile
run: sudo apt-get -y update && sudo apt-get install -y libsndfile1
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
pip install -r docs/requirements.txt
pip install .
- name: Build documentation
run: cd docs && make clean && make html # Use SPHINXOPTS="-W" to fail on warning.
build-and-publish:
needs: documentation
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: install audio library libsndfile
run: sudo apt-get -y update && sudo apt-get install -y libsndfile1
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install wheel
run: pip install wheel
- name: Build a binary wheel and a source tarball
run: python setup.py sdist bdist_wheel
- name: Publish distribution package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_DEPLOYMENT }}
skip_existing: true
- name: Github release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')