-
Notifications
You must be signed in to change notification settings - Fork 29
211 lines (204 loc) · 7.21 KB
/
test.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: Test
on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: "0 0 * * 0"
env:
SC_ORIGIN: https://github.com/supercollider/supercollider.git
SC_BRANCH: develop
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docs:
name: Build docs
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "**/pyproject.toml"
- name: Install APT deps
shell: bash
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update --yes
sudo apt-get install --yes \
espeak \
ffmpeg \
graphviz \
lame
- name: Install SuperCollider
uses: ./.github/actions/supercollider
with:
branch: ${{ env.SC_BRANCH }}
origin: ${{ env.SC_ORIGIN }}
- name: Install Supriya
run: pip install -e .[docs]
- name: Build docs
run: make docs
- name: Check for FailWarning
run: "! grep -R ': FailWarning: ' *"
working-directory: docs/build/html
lint:
name: Lint Supriya
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "**/pyproject.toml"
- name: Install Supriya
run: pip install -e .[ipython,test]
- name: Run Black
run: make black-check
- name: Run docstrfmt
run: |
make docstrfmt || true
make docstrfmt || true
git status
git diff
- name: Run Flake8
run: make flake8
- name: Run Mypy
run: make mypy
package:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
test:
name: Test Supriya
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- os: macos-latest
python-version: "3.12"
- os: windows-latest
python-version: "3.12"
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "**/pyproject.toml"
- name: Upgrade pip
run: python3 -m pip install -U pip
- name: Install Supriya
run: pip install -e .
- name: Install SuperCollider (Non-Windows)
if: ${{ matrix.os != 'windows-latest' }}
uses: ./.github/actions/supercollider
with:
branch: ${{ env.SC_BRANCH }}
origin: ${{ env.SC_ORIGIN }}
- name: Install SuperCollider (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
choco install supercollider
mkdir C:\Users\runneradmin\AppData\Local\SuperCollider\synthdefs
- name: Setup audio (Windows) # https://github.com/actions/runner-images/issues/2528#issuecomment-934857719
# No powershell!
if: ${{ matrix.os == 'windows-latest' }}
run: net start audiosrv
- name: Setup audio (Windows) # https://github.com/actions/runner-images/issues/2528#issuecomment-934857719
# No powershell!
if: ${{ matrix.os == 'windows-latest' }}
run: |
Set-Service -Name vmictimesync -Status stopped -StartupType disabled
Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\services\W32Time\Parameters -Name 'Type' -Value 'NoSync'
net stop w32time; Set-Date (Get-Date "2023-07-04 12:00:00")
- name: Setup audio (Windows) # https://github.com/actions/runner-images/issues/2528#issuecomment-934857719
env:
VERSION: '4.0'
if: ${{ matrix.os == 'windows-latest' }}
# TODO: Remove the time workaround when virtual audio device certificate is valid again, refs:
# https://github.com/duncanthrax/scream/issues/202
run: |
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/${{ env.VERSION }}/Scream${{ env.VERSION }}.zip -OutFile Scream${{ env.VERSION }}.zip
Expand-Archive -Path Scream${{ env.VERSION }}.zip -DestinationPath Scream
Import-Certificate -FilePath Scream\Install\driver\x64\scream.cat -CertStoreLocation Cert:\LocalMachine\TrustedPublisher
Scream\Install\helpers\devcon-x64.exe install Scream\Install\driver\x64\Scream.inf *Scream
shell: powershell
timeout-minutes: 1
- name: Setup audio (Windows) # https://github.com/actions/runner-images/issues/2528#issuecomment-934857719
# No powershell!
if: ${{ matrix.os == 'windows-latest' }}
run: |
Set-Service -Name vmictimesync -Status running -StartupType automatic
Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\services\W32Time\Parameters -Name 'Type' -Value 'NTP'
net start w32time; w32tm /resync /force; $currentDate = Get-Date; Write-Host "Current System Date: $currentDate";
- name: Sanity-check Supriya
run: |
python -c "import logging, supriya; logging.getLogger('supriya').setLevel(logging.INFO); logging.basicConfig(); server = supriya.Server().boot(); exit()"
python -c "from supriya.utils._intervals import IntervalTreeDriverEx; print(IntervalTreeDriverEx)"
- name: Sanity-check Supriya SHM (Non-Windows)
if: ${{ matrix.os != 'windows-latest' }}
run: python -c "from supriya.contexts.shm import ServerSHM; print(ServerSHM)"
- name: Check for stray processes (Non-Windows)
if: ${{ matrix.os != 'windows-latest' }}
run: |
! ( ps aux | grep scsynth | grep -v grep )
! ( ps aux | grep supernova | grep -v grep )
- name: Install Supriya test dependencies
run: pip install -e .[test]
- name: Install ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
- name: Install additional packages
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update --yes
sudo apt-get install --yes \
espeak \
graphviz \
lame
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install \
graphviz
elif [ "$RUNNER_OS" == "Windows" ]; then
choco install \
graphviz \
lame
fi
- name: Run Pytest
run: pytest --cov supriya --showlocals
timeout-minutes: 15
- name: Check for stray processes (Non-Windows)
if: ${{ matrix.os != 'windows-latest' }}
run: |
! ( ps aux | grep scsynth | grep -v grep )
! ( ps aux | grep supernova | grep -v grep )