Test against libmdf-1.0.28 #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Millistream.Streaming CI | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'Source/Millistream.Streaming/**' | |
- 'Tests/Millistream.Streaming.UnitTests/**' | |
- 'Tests/Millistream.Streaming.IntegrationTests/**' | |
- '.github/workflows/millistream.streaming.ci.yml' | |
- '.github/workflows/millistream.streaming.cd.yml' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'Source/Millistream.Streaming/**' | |
- 'Tests/Millistream.Streaming.UnitTests/**' | |
- 'Tests/Millistream.Streaming.IntegrationTests/**' | |
- '.github/workflows/millistream.streaming.ci.yml' | |
- '.github/workflows/millistream.streaming.cd.yml' | |
workflow_dispatch: | |
jobs: | |
Build: | |
strategy: | |
matrix: | |
os: [macOS-latest, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup the .NET 8 SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build on macOS/Linux | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: | | |
dotnet build Source/Millistream.Streaming/Millistream.Streaming.csproj -c Release -f netstandard1.4 | |
dotnet build Tests/Millistream.Streaming.UnitTests/Millistream.Streaming.UnitTests.csproj -c Release -f net8.0 | |
dotnet build Tests/Millistream.Streaming.IntegrationTests/Millistream.Streaming.IntegrationTests.csproj -c Release -f net8.0 | |
- name: Build on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
shell: bash | |
run: | | |
dotnet build Source/Millistream.Streaming/Millistream.Streaming.csproj -c Release | |
dotnet build Tests/Millistream.Streaming.UnitTests/Millistream.Streaming.UnitTests.csproj -c Release | |
dotnet build Tests/Millistream.Streaming.IntegrationTests/Millistream.Streaming.IntegrationTests.csproj -c Release | |
- name: Run Unit Tests on macOS/Linux | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: | | |
dotnet test Tests/Millistream.Streaming.UnitTests/Millistream.Streaming.UnitTests.csproj -c Release -f net8.0 --no-build --no-restore | |
- name: Run Unit Tests on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
dotnet test Tests/Millistream.Streaming.UnitTests/Millistream.Streaming.UnitTests.csproj -c Release --no-build --no-restore | |
- name: Download and Install libmdf on macOS | |
if: ${{ matrix.os == 'macOS-latest' }} | |
run: | | |
wget https://packages.millistream.com/source/libmdf-1.0.28.tar.gz | |
tar -zxf libmdf-1.0.28.tar.gz | |
cd libmdf-1.0.28 | |
./configure --prefix=/usr/local | |
make | |
make install | |
- name: Download and Install libmdf on Linux | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
wget https://packages.millistream.com/source/libmdf-1.0.28.tar.gz | |
tar -zxf libmdf-1.0.28.tar.gz | |
cd libmdf-1.0.28 | |
./configure --prefix=/usr | |
make | |
sudo make install | |
- name: Download and Install libmdf on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
shell: pwsh | |
run: | | |
(new-object System.Net.WebClient).DownloadFile('https://packages.millistream.com/Windows/libmdf-1.0.28.exe','libmdf-1.0.28.exe') | |
.\libmdf-1.0.28.exe /S | |
# Wait for the DLL to appear in C:\Windows\System32 | |
while (-not (Test-Path -Path "C:\Windows\System32\libmdf-0.dll")) { | |
Write-Host "libmdf not found. Waiting..." | |
Start-Sleep -Seconds 1 | |
} | |
- name: Set Credentials | |
shell: pwsh | |
env: | |
HOSTNAME: ${{ secrets.HOSTNAME }} | |
USERNAME: ${{ secrets.USERNAME }} | |
PASSWORD: ${{ secrets.PASSWORD }} | |
run: | | |
[xml]$doc = Get-Content Tests/Millistream.Streaming.IntegrationTests/TestSettings.runsettings | |
$doc.RunSettings.TestRunParameters.ChildNodes.Item(0).value = "$env:HOSTNAME" | |
$doc.RunSettings.TestRunParameters.ChildNodes.Item(1).value = "$env:USERNAME" | |
$doc.RunSettings.TestRunParameters.ChildNodes.Item(2).value = "$env:PASSWORD" | |
$doc.Save("UpdatedTestSettings.runsettings") | |
- name: Run Integration Tests on macOS/Linux | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: | | |
dotnet test Tests/Millistream.Streaming.IntegrationTests/Millistream.Streaming.IntegrationTests.csproj -c Release -f net8.0 --no-build --no-restore -s UpdatedTestSettings.runsettings | |
- name: Run Integration Tests on Windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
dotnet test Tests/Millistream.Streaming.IntegrationTests/Millistream.Streaming.IntegrationTests.csproj -c Release --no-build --no-restore -s UpdatedTestSettings.runsettings | |
- name: Remove the .runsettings file | |
shell: pwsh | |
run: Remove-Item UpdatedTestSettings.runsettings |