Skip to content

Run unit and integration tests on PRs to development and testing #5

Run unit and integration tests on PRs to development and testing

Run unit and integration tests on PRs to development and testing #5

Workflow file for this run

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: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- 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: configure
run: |
cd Build
cmake -G "Visual Studio 17 2022" -A x64 ..
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: build
run: |
cd Build
msbuild ALL_BUILD.vcxproj -p:Configuration=Release -p:Platform=x64 -m
- name: Install open-ephys-data-format
shell: powershell
run: |
New-Item -Path '..\OEPlugins' -ItemType Directory
git clone --branch main https://github.com/open-ephys-plugins/open-ephys-data-format.git ..\OEPlugins\open-ephys-data-format
cd ..\OEPlugins\open-ephys-data-format\Build
cmake -G "Visual Studio 17 2022" -A x64 ..
msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
- name: Install OpenEphysHDF5Lib
shell: powershell
run: |
git clone --branch main https://github.com/open-ephys-plugins/OpenEphysHDF5Lib.git ..\OEPlugins\OpenEphysHDF5Lib
cd ..\OEPlugins\OpenEphysHDF5Lib\Build
cmake -G "Visual Studio 17 2022" -A x64 ..
msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
- name: Install nwb-format
shell: powershell
run: |
git clone --branch main https://github.com/open-ephys-plugins/nwb-format.git ..\OEPlugins\nwb-format
cd ..\OEPlugins\nwb-format\Build
cmake -G "Visual Studio 17 2022" -A x64 ..
msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
- 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: 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