Skip to content

Update ci-pipeline.yml #507

Update ci-pipeline.yml

Update ci-pipeline.yml #507

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.8", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- 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@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: |
pip install -r test/requirements.txt
pip install -r test/torch_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@v4
- 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@v5
with:
python-version: 3.9
- name: Generate coverage report
run: |
pip install -r test/requirements.txt
pip install -r test/torch_requirements.txt
pip install .
coverage run -m pytest test
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
documentation:
needs: multitest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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@v5
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install -r docs/requirements.txt
pip install -r test/torch_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@v4
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@v5
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/')