Release 3.0.0.1 #11
This file contains hidden or 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: Build and Test | |
| on: | |
| pull_request: | |
| branches: | |
| - dev | |
| - master | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| permissions: write-all | |
| # Only when run from the main repo | |
| if: github.repository == 'Microsoft365DSC/DSCParser' | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore Dependencies | |
| shell: pwsh | |
| run: | | |
| dotnet restore ./src/DSCParser.sln | |
| - name: Build Solution | |
| shell: pwsh | |
| run: | | |
| dotnet build ./src/DSCParser.sln -c Release --no-restore | |
| - name: Run C# Tests | |
| shell: pwsh | |
| run: | | |
| dotnet test --project ./src/DSCParser.Tests/DSCParser.Tests.csproj -c Release --report-trx --no-build --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml | |
| - name: Build PowerShell Module | |
| shell: pwsh | |
| run: | | |
| & ./Utilities/Build.ps1 -Configuration Release | |
| - name: Validate Module Manifest | |
| shell: pwsh | |
| run: | | |
| Test-ModuleManifest -Path ./DSCParser/DSCParser.psd1 | |
| - name: Validate Module Import | |
| shell: pwsh | |
| run: | | |
| Import-Module ./DSCParser/DSCParser.psd1 -Force -ErrorAction Stop | |
| $exportedFunctions = (Get-Module DSCParser).ExportedFunctions.Keys | |
| if ($exportedFunctions.Count -eq 0) | |
| { | |
| throw "No functions exported from the DSCParser module." | |
| } | |
| Write-Host "Exported functions: $($exportedFunctions -join ', ')" |