1+ name : Tests
2+
3+ on :
4+ pull_request :
5+ paths :
6+ - ' JuceLibraryCode/**'
7+ - ' Plugins/**'
8+ - ' Resources/**'
9+ - ' Source/**'
10+ - ' CMakeLists.txt'
11+ - ' HelperFunctions.cmake'
12+ branches :
13+ - ' development'
14+ - ' testing'
15+
16+ jobs :
17+ unit-tests :
18+ name : Unit Tests
19+ runs-on : ubuntu-22.04
20+
21+ steps :
22+ - uses : actions/checkout@v4
23+ - name : build
24+ env :
25+ CC : gcc-10
26+ CXX : g++-10
27+ run : |
28+ sudo apt update
29+ cd Resources/Scripts
30+ sudo ./install_linux_dependencies.sh
31+ git apply gha_unit_tests.patch
32+ cd ../../Build && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON ..
33+ make -j8
34+ - name : run tests
35+ run : |
36+ cd Resources/Scripts
37+ chmod +x run_unit_tests_linux.sh
38+ ./run_unit_tests_linux.sh
39+ shell : bash
40+
41+ integration-tests :
42+ name : Integration Tests
43+ runs-on : windows-2022
44+
45+ steps :
46+ - uses : actions/checkout@v4
47+ with :
48+ fetch-depth : 0
49+ - name : Start Windows Audio Engine
50+ run : net start audiosrv
51+ - name : Install Scream
52+ shell : powershell
53+ run : |
54+ Start-Service audio*
55+ Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip
56+ Expand-7ZipArchive -Path C:\Scream3.6.zip -DestinationPath C:\Scream
57+ $cert = (Get-AuthenticodeSignature C:\Scream\Install\driver\Scream.sys).SignerCertificate
58+ $store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine")
59+ $store.Open("ReadWrite")
60+ $store.Add($cert)
61+ $store.Close()
62+ cd C:\Scream\Install\driver
63+ C:\Scream\Install\helpers\devcon install Scream.inf *Scream
64+ - name : Show audio device
65+ run : Get-CimInstance Win32_SoundDevice | fl *
66+ - name : configure
67+ run : |
68+ cd Build
69+ cmake -G "Visual Studio 17 2022" -A x64 ..
70+ - name : Add msbuild to PATH
71+ 72+ - name : build
73+ run : |
74+ cd Build
75+ msbuild ALL_BUILD.vcxproj -p:Configuration=Release -p:Platform=x64 -m
76+ - name : Install open-ephys-data-format
77+ shell : powershell
78+ run : |
79+ New-Item -Path '..\OEPlugins' -ItemType Directory
80+ git clone --branch main https://github.com/open-ephys-plugins/open-ephys-data-format.git ..\OEPlugins\open-ephys-data-format
81+ cd ..\OEPlugins\open-ephys-data-format\Build
82+ cmake -G "Visual Studio 17 2022" -A x64 ..
83+ msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
84+ - name : Install OpenEphysHDF5Lib
85+ shell : powershell
86+ run : |
87+ git clone --branch main https://github.com/open-ephys-plugins/OpenEphysHDF5Lib.git ..\OEPlugins\OpenEphysHDF5Lib
88+ cd ..\OEPlugins\OpenEphysHDF5Lib\Build
89+ cmake -G "Visual Studio 17 2022" -A x64 ..
90+ msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
91+ - name : Install nwb-format
92+ shell : powershell
93+ run : |
94+ git clone --branch main https://github.com/open-ephys-plugins/nwb-format.git ..\OEPlugins\nwb-format
95+ cd ..\OEPlugins\nwb-format\Build
96+ cmake -G "Visual Studio 17 2022" -A x64 ..
97+ msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
98+ - name : Install test-suite
99+ shell : powershell
100+ run : |
101+ git clone --branch juce8 https://github.com/open-ephys/open-ephys-python-tools.git C:\open-ephys-python-tools
102+ cd C:\open-ephys-python-tools
103+ pip install -e .
104+ pip install psutil
105+ - name : Run Tests
106+ shell : powershell
107+ run : |
108+ git clone --branch main https://github.com/open-ephys-plugins/open-ephys-test-suite.git C:\test-suite
109+ cd C:\test-suite
110+ $process = Start-Process -FilePath "Build\Release\open-ephys.exe" -ArgumentList "Build\Release\configs\file_reader_config.xml" -NoNewWindow -PassThru
111+ Write-Host "Started open-ephys process with ID: $($process.Id)"
112+ Start-Sleep -Seconds 10
113+ Write-Host "Starting Python script..."
114+ python run_all.py 2>&1 | Tee-Object -FilePath "python_output.log"
115+ Write-Host "Python script completed. Output saved to python_output.log"
116+ Stop-Process -Id $process.Id -Force
117+ env :
118+ OE_WINDOWS_GITHUB_RECORD_PATH : C:\open-ephys\data
119+ - name : Set timestamp
120+ shell : powershell
121+ id : timestamp
122+ run : |
123+ $timestamp = Get-Date -Format 'yyyy_MM_dd_HH_mm_ss'
124+ "timestamp=$timestamp" >> $env:GITHUB_OUTPUT
125+ - name : Upload test results
126+ uses : actions/upload-artifact@v4
127+ with :
128+ name : windows_${{ steps.timestamp.outputs.timestamp }}.log
129+ path : python_output.log
130+ retention-days : 7
0 commit comments