-
Notifications
You must be signed in to change notification settings - Fork 3
117 lines (110 loc) · 3.39 KB
/
main.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: CI
on:
push:
branches:
- main
- release
pull_request:
branches:
- main
env:
PIP_CACHE_DIR: ${{ github.workspace }}/.cache/pip
jobs:
test:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
strategy:
matrix:
python-version: [3.9, '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and run tests
run: |
sudo apt-get update -qq
sudo apt-get -y install libsndfile1
python -m venv venv
source venv/bin/activate
pip install ".[docs,dev]"
python -m pytest --cov dispel --cov-report term --cov-report xml:coverage.xml --junitxml junit.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
file: coverage.xml
flags: unittests
name: codecov-umbrella
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install linters
run: pip install mypy ruff isort black types-Deprecated types-docutils
- name: Run linters
run: |
mypy dispel
ruff dispel tests
isort -c dispel tests
black dispel tests --check
doc_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install doc8
run: pip install doc8
- name: Run doc8
run: doc8 docs *.rst --ignore-path docs/_build --ignore-path README.rst --max-line-length 88
doc_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies and run doc tests
run: |
pip install ".[docs]" pytest pytest-xdist pytest-doctestplus mypy-extensions
python -m pytest --doctest-glob="*.rst" --doctest-plus ".[docs,dispel]" --junitxml junit.xml
release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/release'
steps:
- uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: 18
- name: Install semantic-release
run: npm install semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/github -D
- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
pages:
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: pip install ".[docs]" pytest pytest-xdist pytest-doctestplus mypy-extensions
- name: Generate documentation
run: |
sphinx-apidoc -e -M -o docs/api dispel
make -C docs html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./docs/_build/html
github_token: ${{ secrets.GITHUB_TOKEN }}