add tests #9
Workflow file for this run
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
# Build SampleIntegration.sln and DynamoSamples.sln with .NET 8.0 | |
name: Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout DynamoSamples Repo | |
uses: actions/checkout@v4 | |
with: | |
path: DynamoSamples | |
repository: DynamoDS/DynamoSamples | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Disable problem matcher | |
run: echo "::remove-matcher owner=csc::" | |
- name: Setup msbuild | |
uses: microsoft/[email protected] | |
- name: Install dependencies for SampleIntegration | |
run: | | |
dotnet restore ${{ github.workspace }}\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release --runtime=win-x64 | |
- name: Build SampleIntegration | |
run: | | |
msbuild ${{ github.workspace }}\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release | |
- name: Look for Sample Integration | |
run: | | |
if (Test-Path -Path "${{ github.workspace }}\DynamoSamples\src\SampleIntegration\bin\Release\SampleIntegration.dll") { | |
Write-Output "SampleIntegration.dll exists!" | |
} else { | |
Write-Error "SampleIntegration.dll was not found!" | |
} | |
- name: Install dependencies for DynamoSamples | |
run: | | |
dotnet restore ${{ github.workspace }}\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release --runtime=win-x64 | |
- name: Build DynamoSamples | |
run: | | |
msbuild ${{ github.workspace }}\DynamoSamples\src\DynamoSamples.sln /p:Configuration=Release | |
- name: Look for Sample Packages | |
run: | | |
$paths = @( | |
"${{ github.workspace }}\DynamoSamples\dynamo_linter\Sample Linter\bin\SampleLinter.dll", | |
"${{ github.workspace }}\DynamoSamples\dynamo_package\Dynamo Samples\bin\SampleLibraryUI.dll", | |
"${{ github.workspace }}\DynamoSamples\dynamo_package\Dynamo Samples\bin\SampleLibraryZeroTouch.dll", | |
"${{ github.workspace }}\DynamoSamples\dynamo_package\Dynamo Samples\bin\SampleZeroTouchUnits.dll", | |
"${{ github.workspace }}\DynamoSamples\dynamo_viewExtension\Sample View Extension\bin\SampleViewExtension.dll" | |
) | |
foreach ($path in $paths) { | |
if (Test-Path -Path $path) { | |
Write-Output "$path exists!" | |
} else { | |
Write-Error "$path was not found!" | |
} | |
} | |
- name: Get DynamoRuntime from s3 | |
run: | | |
curl -o DynamoRuntime.zip https://dyn-builds-data.s3-us-west-2.amazonaws.com/DynamoCoreRuntime_3.1.0.3755_20240111T1041.zip | |
ls | |
- name: Extract DynamoRuntime | |
run: | | |
7z x DynamoRuntime.zip -o${{ github.workspace }}\DynamoSamples\src\SampleLibraryTests\bin\Release\DynamoRuntime | |
- name: Run test with the dotnet CLI | |
run: | | |
dotnet test ${{ github.workspace }}\DynamoSamples\src\SampleLibraryTests -p:Configuration=Release --filter "TestCategory!=Failure" --logger "trx;LogFileName=results.trx" --results-directory ${{ github.workspace }}\DynamoSamples\TestResults | |
- name: Upload build artifact | |
uses: actions/[email protected] | |
with: | |
name: DynamoSamples | |
path: ${{ github.workspace }}\DynamoSamples\dynamo_package | |
retention-days: 7 | |
- name: Upload test artifact | |
uses: actions/[email protected] | |
with: | |
name: TestResults | |
path: ${{ github.workspace }}\DynamoSamples\TestResults | |
retention-days: 1 |