-
Notifications
You must be signed in to change notification settings - Fork 12
83 lines (79 loc) · 2.5 KB
/
ci.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
name: CI
on: [push]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- { os: macos-latest, python: "3.7" } # not available for newer arm64 macos
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/cache@v4
with:
path: .tox
key: ${{ matrix.os }}-${{ matrix.python }}-tox-${{ hashFiles('pyproject.toml', 'setup.py') }}
- name: Install libsndfile
if: matrix.os == 'ubuntu-latest'
run: sudo apt install -y libsndfile1
- name: Install Tox
run: pip install tox
- name: Run ruff
run: tox -e ruff
- name: Run mypy
run: tox -e mypy
- name: Run pytest
run: tox -e py
- name: Run pytest with numba
run: tox -e py-numba
- name: Run PyInstaller test
run: tox -e pyinstaller
- name: Coverage report
run: tox -e coverage-report
- name: Upload coverage results to Coveralls
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.12'
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage.xml
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install libsndfile
run: sudo apt install -y libsndfile1
- name: Install Tox
run: pip install tox
- name: Check docs
run: tox -e docs
publish:
needs: [test, docs] # only run if previous jobs are successful
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install pypa/build
run: python -m pip install build --user
- name: Build source distribution and wheel
run: python -m build --outdir dist/ .
- name: Publish package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: Publish package to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1