Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/actions/test/nix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ inputs:
required: false
default: ctrf
type: string
GITHUB_TOKEN:
description: 'GitHub token for API authentication'
required: true

runs:
using: composite
Expand Down Expand Up @@ -66,7 +69,10 @@ runs:
shell: pwsh
run: |-
Import-Module ./.github/workflows/GHWorkflowHelper/GHWorkflowHelper.psm1
$releases = Invoke-RestMethod -Uri "https://api.github.com/repos/PowerShell/Dsc/releases"
$headers = @{
Authorization = "Bearer ${{ inputs.GITHUB_TOKEN }}"
}
$releases = Invoke-RestMethod -Uri "https://api.github.com/repos/PowerShell/Dsc/releases" -Headers $headers
$latestRelease = $releases | Where-Object { $v = $_.name.trim("v"); $semVer = [System.Management.Automation.SemanticVersion]::new($v); if ($semVer.Major -eq 3 -and $semVer.Minor -ge 2) { $_ } } | Select-Object -First 1
$latestVersion = $latestRelease.tag_name.TrimStart("v")
Write-Host "Latest DSC Version: $latestVersion"
Expand All @@ -80,7 +86,7 @@ runs:

$tempPath = Get-GWTempPath

Invoke-RestMethod -Uri $downloadUrl -OutFile "$tempPath/DSC.tar.gz" -Verbose
Invoke-RestMethod -Uri $downloadUrl -OutFile "$tempPath/DSC.tar.gz" -Verbose -Headers $headers
New-Item -ItemType Directory -Path "$tempPath/DSC" -Force -Verbose
tar xvf "$tempPath/DSC.tar.gz" -C "$tempPath/DSC"
$dscRoot = "$tempPath/DSC"
Expand Down
10 changes: 8 additions & 2 deletions .github/actions/test/windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ inputs:
required: false
default: ctrf
type: string
GITHUB_TOKEN:
description: 'GitHub token for API authentication'
required: true

runs:
using: composite
Expand Down Expand Up @@ -49,15 +52,18 @@ runs:
shell: pwsh
run: |-
Import-Module .\.github\workflows\GHWorkflowHelper\GHWorkflowHelper.psm1
$releases = Invoke-RestMethod -Uri "https://api.github.com/repos/PowerShell/Dsc/releases"
$headers = @{
Authorization = "Bearer ${{ inputs.GITHUB_TOKEN }}"
}
$releases = Invoke-RestMethod -Uri "https://api.github.com/repos/PowerShell/Dsc/releases" -Headers $headers
$latestRelease = $releases | Where-Object { $v = $_.name.trim("v"); $semVer = [System.Management.Automation.SemanticVersion]::new($v); if ($semVer.Major -eq 3 -and $semVer.Minor -ge 2) { $_ } } | Select-Object -First 1
$latestVersion = $latestRelease.tag_name.TrimStart("v")
Write-Host "Latest DSC Version: $latestVersion"

$downloadUrl = $latestRelease.assets | Where-Object { $_.name -like "DSC-*-x86_64-pc-windows-msvc.zip" } | Select-Object -First 1 | Select-Object -ExpandProperty browser_download_url
Write-Host "Download URL: $downloadUrl"
$tempPath = Get-GWTempPath
Invoke-RestMethod -Uri $downloadUrl -OutFile "$tempPath\DSC.zip"
Invoke-RestMethod -Uri $downloadUrl -OutFile "$tempPath\DSC.zip" -Headers $headers

$null = New-Item -ItemType Directory -Path "$tempPath\DSC" -Force
Expand-Archive -Path "$tempPath\DSC.zip" -DestinationPath "$tempPath\DSC" -Force
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ jobs:
with:
purpose: UnelevatedPesterTests
tagSet: CI
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linux_test_elevated_ci:
name: Linux Elevated CI
needs:
Expand All @@ -112,6 +113,7 @@ jobs:
with:
purpose: ElevatedPesterTests
tagSet: CI
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linux_test_unelevated_others:
name: Linux Unelevated Others
needs:
Expand All @@ -129,6 +131,7 @@ jobs:
with:
purpose: UnelevatedPesterTests
tagSet: Others
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linux_test_elevated_others:
name: Linux Elevated Others
needs:
Expand All @@ -146,6 +149,7 @@ jobs:
with:
purpose: ElevatedPesterTests
tagSet: Others
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xunit_tests:
name: xUnit Tests
needs:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ jobs:
with:
purpose: UnelevatedPesterTests
tagSet: CI
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
macos_test_elevated_ci:
name: macOS Elevated CI
needs:
Expand All @@ -109,6 +110,7 @@ jobs:
with:
purpose: ElevatedPesterTests
tagSet: CI
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
macos_test_unelevated_others:
name: macOS Unelevated Others
needs:
Expand All @@ -126,6 +128,7 @@ jobs:
with:
purpose: UnelevatedPesterTests
tagSet: Others
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
macos_test_elevated_others:
name: macOS Elevated Others
needs:
Expand All @@ -143,6 +146,7 @@ jobs:
with:
purpose: ElevatedPesterTests
tagSet: Others
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xunit_tests:
name: xUnit Tests
needs:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ jobs:
with:
purpose: UnelevatedPesterTests
tagSet: CI
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
windows_test_elevated_ci:
name: Windows Elevated CI
needs:
Expand All @@ -113,6 +114,7 @@ jobs:
with:
purpose: ElevatedPesterTests
tagSet: CI
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
windows_test_unelevated_others:
name: Windows Unelevated Others
needs:
Expand All @@ -130,6 +132,7 @@ jobs:
with:
purpose: UnelevatedPesterTests
tagSet: Others
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
windows_test_elevated_others:
name: Windows Elevated Others
needs:
Expand All @@ -147,6 +150,7 @@ jobs:
with:
purpose: ElevatedPesterTests
tagSet: Others
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xunit_tests:
name: xUnit Tests
needs:
Expand Down
Loading