forked from open-ephys/plugin-GUI
-
Notifications
You must be signed in to change notification settings - Fork 0
227 lines (222 loc) · 9.04 KB
/
Copy pathtests.yml
File metadata and controls
227 lines (222 loc) · 9.04 KB
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: Tests
on:
pull_request:
paths:
- 'JuceLibraryCode/**'
- 'Plugins/**'
- 'Resources/**'
- 'Source/**'
- 'CMakeLists.txt'
- 'HelperFunctions.cmake'
branches:
- 'development'
- 'testing'
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: build
env:
CC: gcc-10
CXX: g++-10
run: |
sudo apt update
sudo ./Resources/Scripts/install_linux_dependencies.sh
git apply Resources/Scripts/gha_unit_tests.patch
cd Build && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON ..
make -j8
- name: run tests
run: |
chmod +x ./Resources/Scripts/run_unit_tests_linux.sh
./Resources/Scripts/run_unit_tests_linux.sh Build/TestBin
shell: bash
integration-tests:
name: Integration Tests
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Start Windows Audio Engine
run: net start audiosrv
- name: Install Scream
shell: powershell
run: |
Start-Service audio*
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip
Expand-7ZipArchive -Path C:\Scream3.6.zip -DestinationPath C:\Scream
$cert = (Get-AuthenticodeSignature C:\Scream\Install\driver\Scream.sys).SignerCertificate
$store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine")
$store.Open("ReadWrite")
$store.Add($cert)
$store.Close()
cd C:\Scream\Install\driver
C:\Scream\Install\helpers\devcon install Scream.inf *Scream
- name: Show audio device
run: Get-CimInstance Win32_SoundDevice | fl *
- name: Get source hash
id: source-hash
run: |
hash=$(git ls-tree -r HEAD --name-only Source Plugins JuceLibraryCode CMakeLists.txt HelperFunctions.cmake | git hash-object --stdin-paths | cut -c1-16)
echo "hash=$hash" >> $GITHUB_OUTPUT
shell: bash
- name: Restore build cache
uses: actions/cache@v4
id: build-cache
with:
path: Build
key: windows-build-${{ steps.source-hash.outputs.hash }}
restore-keys: |
windows-build-
- name: configure
if: steps.build-cache.outputs.cache-hit != 'true'
run: |
cd Build
cmake -G "Visual Studio 17 2022" -A x64 ..
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: build
if: steps.build-cache.outputs.cache-hit != 'true'
run: |
cd Build
msbuild ALL_BUILD.vcxproj -p:Configuration=Release -p:Platform=x64 -m
- name: Save build cache
if: steps.build-cache.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: Build
key: windows-build-${{ steps.source-hash.outputs.hash }}
- name: Get plugin commit hashes
id: plugin-hashes
shell: bash
run: |
data_format_hash=$(git ls-remote https://github.com/open-ephys-plugins/open-ephys-data-format.git main | cut -f1 | cut -c1-16)
hdf5_hash=$(git ls-remote https://github.com/open-ephys-plugins/OpenEphysHDF5Lib.git main | cut -f1 | cut -c1-16)
nwb_hash=$(git ls-remote https://github.com/open-ephys-plugins/nwb-format.git main | cut -f1 | cut -c1-16)
echo "data-format=$data_format_hash" >> $GITHUB_OUTPUT
echo "hdf5=$hdf5_hash" >> $GITHUB_OUTPUT
echo "nwb=$nwb_hash" >> $GITHUB_OUTPUT
- name: Restore open-ephys-data-format cache
uses: actions/cache@v4
id: cache-data-format
with:
path: C:\OEPlugins\open-ephys-data-format
key: plugin-data-format-${{ steps.plugin-hashes.outputs.data-format }}
restore-keys: |
plugin-data-format-
- name: Build open-ephys-data-format
if: steps.cache-data-format.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path 'C:\OEPlugins' -ItemType Directory -Force
git clone --branch main https://github.com/open-ephys-plugins/open-ephys-data-format.git C:\OEPlugins\open-ephys-data-format
cd C:\OEPlugins\open-ephys-data-format\Build
cmake -G "Visual Studio 17 2022" -A x64 ..
msbuild ALL_BUILD.vcxproj -p:Configuration=Release -p:Platform=x64 -m
- name: Install open-ephys-data-format
shell: powershell
run: |
cd C:\OEPlugins\open-ephys-data-format\Build
msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
- name: Save open-ephys-data-format cache
if: steps.cache-data-format.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: C:\OEPlugins\open-ephys-data-format
key: plugin-data-format-${{ steps.plugin-hashes.outputs.data-format }}
- name: Restore OpenEphysHDF5Lib cache
uses: actions/cache@v4
id: cache-hdf5
with:
path: C:\OEPlugins\OpenEphysHDF5Lib
key: plugin-hdf5-${{ steps.plugin-hashes.outputs.hdf5 }}
restore-keys: |
plugin-hdf5-
- name: Build OpenEphysHDF5Lib
if: steps.cache-hdf5.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path 'C:\OEPlugins' -ItemType Directory -Force
git clone --branch main https://github.com/open-ephys-plugins/OpenEphysHDF5Lib.git C:\OEPlugins\OpenEphysHDF5Lib
cd C:\OEPlugins\OpenEphysHDF5Lib\Build
cmake -G "Visual Studio 17 2022" -A x64 ..
msbuild ALL_BUILD.vcxproj -p:Configuration=Release -p:Platform=x64 -m
- name: Install OpenEphysHDF5Lib
shell: powershell
run: |
cd C:\OEPlugins\OpenEphysHDF5Lib\Build
msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
- name: Save OpenEphysHDF5Lib cache
if: steps.cache-hdf5.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: C:\OEPlugins\OpenEphysHDF5Lib
key: plugin-hdf5-${{ steps.plugin-hashes.outputs.hdf5 }}
- name: Restore nwb-format cache
uses: actions/cache@v4
id: cache-nwb
with:
path: C:\OEPlugins\nwb-format
key: plugin-nwb-${{ steps.plugin-hashes.outputs.nwb }}
restore-keys: |
plugin-nwb-
- name: Build nwb-format
if: steps.cache-nwb.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path 'C:\OEPlugins' -ItemType Directory -Force
git clone --branch main https://github.com/open-ephys-plugins/nwb-format.git C:\OEPlugins\nwb-format
cd C:\OEPlugins\nwb-format\Build
cmake -G "Visual Studio 17 2022" -A x64 ..
msbuild ALL_BUILD.vcxproj -p:Configuration=Release -p:Platform=x64 -m
- name: Install nwb-format
shell: powershell
run: |
cd C:\OEPlugins\nwb-format\Build
msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
- name: Save nwb-format cache
if: steps.cache-nwb.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: C:\OEPlugins\nwb-format
key: plugin-nwb-${{ steps.plugin-hashes.outputs.nwb }}
- name: Install test-suite
shell: powershell
run: |
git clone --branch main https://github.com/open-ephys/open-ephys-python-tools.git C:\open-ephys-python-tools
cd C:\open-ephys-python-tools
pip install -e .
pip install psutil
- name: Run Tests
shell: powershell
run: |
New-Item -Path 'C:\open-ephys\data' -ItemType Directory
git clone --branch main https://github.com/open-ephys/open-ephys-test-suite.git C:\test-suite
cd C:\test-suite
$process = Start-Process -FilePath "Build\Release\open-ephys.exe" -ArgumentList "Build\Release\configs\file_reader_config.xml" -NoNewWindow -PassThru
Write-Host "Started open-ephys process with ID: $($process.Id)"
Start-Sleep -Seconds 10
Write-Host "Starting Python script..."
python run_all.py 2>&1 | Tee-Object -FilePath "python_output.log"
Write-Host "Python script completed. Output saved to python_output.log"
Stop-Process -Id $process.Id -Force
env:
OE_WINDOWS_GITHUB_RECORD_PATH: C:\open-ephys\data
- name: Display Full Traceback
if: failure()
shell: powershell
run: Get-Content "python_output.log"
- name: Set timestamp
shell: powershell
id: timestamp
run: |
$timestamp = Get-Date -Format 'yyyy_MM_dd_HH_mm_ss'
"timestamp=$timestamp" >> $env:GITHUB_OUTPUT
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: windows_${{ steps.timestamp.outputs.timestamp }}.log
path: python_output.log
retention-days: 7