-
Notifications
You must be signed in to change notification settings - Fork 46
97 lines (92 loc) · 3.01 KB
/
ci-pipeline.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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@v3
- 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@v3
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@v3
- 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@v3
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@v3
documentation:
needs: multitest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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@v3
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@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@v3
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/')