Skip to content

381 generate collision contacts #573

381 generate collision contacts

381 generate collision contacts #573

name: Build/Test/Publish
on:
push:
branches: [master]
pull_request:
branches: [master]
# Schedule on first day of each month to prevent all artifacts removal due to 90 days of retention.
schedule:
- cron: '0 0 1 * *'
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
defaults:
run:
shell: powershell
jobs:
build-test-publish:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: Set up .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Build solution
run: dotnet build Geisha.sln --configuration Debug
- name: Install Scream virtual audio device
run: |
Start-Service audio*
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip
Expand-Archive -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
Get-CimInstance Win32_SoundDevice | fl * # Print audio device info.
- name: Execute tests
run: dotnet test Geisha.sln --configuration Debug --no-build --logger "trx;LogFileName=test-results.trx"
- name: Publish test results
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Test Results
path: test/**/test-results.trx
reporter: dotnet-trx
- name: Publish NuGet packages
run: |
$projectVersion = Get-Content -Path "project.version" -Raw
$versionToSet = "$projectVersion+$env:GITHUB_RUN_NUMBER"
$fileVersionToSet = "$projectVersion.$env:GITHUB_RUN_NUMBER"
dotnet publish Geisha.sln --configuration Release -p:Version=$versionToSet -p:FileVersion=$fileVersionToSet
- name: Prepare SDK package
run: .\scripts\workflow\prepare-sdk-package.ps1 $env:GITHUB_RUN_NUMBER
- name: Upload SDK package as artifact
uses: actions/upload-artifact@v3
with:
name: sdk-package
path: GeishaSDK*.zip
- name: Prepare Demo App package
run: .\scripts\workflow\prepare-demo-app-package.ps1 $env:GITHUB_RUN_NUMBER
- name: Upload Demo App package as artifact
uses: actions/upload-artifact@v3
with:
name: demo-app
path: Geisha.Demo*.zip
- name: Prepare Benchmark App package
run: .\scripts\workflow\prepare-benchmark-app-package.ps1 $env:GITHUB_RUN_NUMBER
- name: Upload Benchmark App package as artifact
uses: actions/upload-artifact@v3
with:
name: benchmark-app
path: Geisha.Benchmark*.zip
benchmark-preformance:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
- name: Set up .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Build solution
run: dotnet build Geisha.sln --configuration Release
- name: Install Scream virtual audio device
run: |
Start-Service audio*
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip
Expand-Archive -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
Get-CimInstance Win32_SoundDevice | fl * # Print audio device info.
- name: Download benchmark binaries from latest master build
uses: dawidd6/action-download-artifact@v2
with:
workflow: build-test-publish.yml
workflow_conclusion: success
branch: master
name: benchmark-app
path: benchmark-app
- name: Unpack benchmark binaries from latest master build
run: |
cd benchmark-app\
Expand-Archive -Path .\Geisha.Benchmark.*.zip
- name: Execute performance benchmarks (current 1)
run: |
cd benchmark\Geisha.Benchmark\bin\Release\net6.0-windows\win-x64\
.\Geisha.Benchmark.exe 2>&1 | Out-Default
- name: Execute performance benchmarks (master 1)
run: |
cd benchmark-app\Geisha.Benchmark.*\
.\Geisha.Benchmark.exe 2>&1 | Out-Default
- name: Execute performance benchmarks (current 2)
run: |
cd benchmark\Geisha.Benchmark\bin\Release\net6.0-windows\win-x64\
.\Geisha.Benchmark.exe 2>&1 | Out-Default
- name: Execute performance benchmarks (master 2)
run: |
cd benchmark-app\Geisha.Benchmark.*\
.\Geisha.Benchmark.exe 2>&1 | Out-Default
- name: Publish benchmark results
run: |
$prSha = "${{github.event.pull_request.head.sha}}"
$commitSha = "${{ github.sha }}"
if ($prSha) { $headSha = $prSha } else { $headSha = $commitSha }
.\scripts\workflow\publish-benchmark-results.ps1 $headSha ${{ secrets.GITHUB_TOKEN }}