Skip to content

Implemented #8, #9 and #10 #122

Implemented #8, #9 and #10

Implemented #8, #9 and #10 #122

name: 🛠️ .NET Desktop
on:
push:
paths-ignore: [HexEditorStructures/**, Images/**, Core/mbedTLS_AES/**, "*.*", ".github/**/util_*"]
pull_request:
paths-ignore: [HexEditorStructures/**, Images/**, Core/mbedTLS_AES/**, "*.*", ".github/**/util_*"]
# Stop the same workflow actions
concurrency:
group: ${{github.workflow}}-${{github.event.pull_request.number || github.ref}}
cancel-in-progress: true
env:
Artifact_Name: GodotPCKExplorer
Project_Name: GodotPCKExplorer.UI
MSBuild_Project_Name: Explorer\GodotPCKExplorer_UI
Bruteforcer_Project_Name: Bruteforcer\PCKBruteforcer_UI
Solution_Path: GodotPCKExplorer.sln
SDK_Name: net8.0-windows
Platform_Name: x64
jobs:
build:
name: Build ${{matrix.configuration}}
strategy:
fail-fast: false
matrix:
configuration: [Debug, Release]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.3.1
# Add nuget to cache
- name: Setup Cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{runner.os}}-nuget-${{hashFiles('**/*.csproj')}}
restore-keys: |
${{runner.os}}-nuget
# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore nuget packages
run: msbuild ${{env.Solution_Path}} /t:Restore /p:Configuration=${{matrix.configuration}}
- name: Build ${{env.MSBuild_Project_Name}}
shell: powershell
run: msbuild ${{env.Solution_Path}} /t:${{env.MSBuild_Project_Name}} /p:Configuration=${{matrix.configuration}} /p:Platform="${{env.Platform_Name}}" /m:4
- name: Prepare artifacts
if: matrix.configuration == 'Release'
shell: powershell
run: |
Get-ChildItem "bin/${{env.Project_Name}}/x64/${{matrix.configuration}}/" -Directory | ForEach-Object {
Get-ChildItem $_.FullName | Where-Object { ('.pdb', '.xml').Contains($_.Extension) } | Remove-Item -Force
}
- name: Upload build artifacts
if: matrix.configuration == 'Release'
uses: actions/upload-artifact@v4
with:
name: ${{env.Artifact_Name}}
path: bin/${{env.Project_Name}}/x64/${{matrix.configuration}}/${{env.SDK_Name}}
- name: Upload build artifacts
if: matrix.configuration != 'Release'
uses: actions/upload-artifact@v4
with:
name: ${{env.Artifact_Name}}_${{matrix.configuration}}
path: bin/${{env.Project_Name}}/${{matrix.configuration}}/${{env.SDK_Name}}
- name: Build ${{env.Bruteforcer_Project_Name}}
shell: powershell
run: msbuild ${{env.Solution_Path}} /t:${{env.Bruteforcer_Project_Name}} /p:Configuration=${{matrix.configuration}} /p:Platform="${{env.Platform_Name}}" /m:4
tests:
name: Tests
#needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run unit tests
shell: bash
run: dotnet test Tests -p:Parallel=0