From 46d1f671fc4a1d0eaa7554f3706fd6ddc55c16be Mon Sep 17 00:00:00 2001 From: kekkon Date: Fri, 22 Mar 2024 00:31:14 +0100 Subject: [PATCH] Rename powershell module, add debug info to pipeline --- .github/workflows/main.yaml | 6 +++++- Get-Versions.psm1 => Build-Functions.psm1 | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) rename Get-Versions.psm1 => Build-Functions.psm1 (71%) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3b83382..4794ca4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -26,7 +26,7 @@ jobs: shell: pwsh id: versionManifest run: | - Import-Module -Force .\Get-Versions.psm1 + Import-Module -Force .\Build-Functions.psm1 Write-Output "::debug::Generating package versions" $versionManifest = Get-Versions "versionManifest='$($versionManifest | ConvertTo-Json)'" | Out-File -FilePath $env:GITHUB_OUTPUT -Append @@ -48,12 +48,16 @@ jobs: - name: Summarize shell: pwsh run: | + Import-Module -Force .\Build-Functions.psm1 Write-Output "::debug::Package lock file location" + Get-LockFiles | ForEach-Object { Write-Output "::debug::\t- $_"} + Write-Output "::debug::Working directory: $(pwd)" - uses: actions/setup-dotnet@v4 name: Setup dotnet cli with: global-json-file: global.json cache: true + cache-dependency-path: src/*/packages.lock.json - name: Restore (locked) shell: pwsh run: dotnet restore --locked-mode diff --git a/Get-Versions.psm1 b/Build-Functions.psm1 similarity index 71% rename from Get-Versions.psm1 rename to Build-Functions.psm1 index 656a800..912c344 100644 --- a/Get-Versions.psm1 +++ b/Build-Functions.psm1 @@ -17,5 +17,14 @@ function Get-Versions { $packageVersions | ConvertTo-Json | Write-Output } +function Get-LockFiles { + $lockFiles = Get-Item -Path src/**/packages.lock.json | Select-Object -ExpandProperty FullName + Write-Debug "Found the following lock files:" + $lockFiles | ForEach-Object { Write-Debug "\t- $_" } + + $lockFiles | Write-Output +} + Install-Module -Name powershell-yaml -Force -AcceptLicense -Export-ModuleMember -Function Get-Versions \ No newline at end of file +Export-ModuleMember -Function Get-Versions +Export-ModuleMember -Function Get-LockFiles \ No newline at end of file