@@ -9,20 +9,20 @@ Describe "Linux Package Name Validation" {
99 } else {
1010 $env: SYSTEM_ARTIFACTSDIRECTORY
1111 }
12-
12+
1313 if (-not $artifactsDir ) {
1414 throw " Artifacts directory not found. GITHUB_WORKSPACE or SYSTEM_ARTIFACTSDIRECTORY must be set."
1515 }
16-
16+
1717 Write-Verbose " Artifacts directory: $artifactsDir " - Verbose
1818 }
19-
19+
2020 Context " RPM Package Names" {
2121 It " Should have valid RPM package names" {
2222 $rpmPackages = Get-ChildItem - Path $artifactsDir - Recurse - Filter * .rpm - ErrorAction SilentlyContinue
23-
23+
2424 $rpmPackages.Count | Should - BeGreaterThan 0 - Because " At least one RPM package should exist in the artifacts directory"
25-
25+
2626 $invalidPackages = @ ()
2727 # Regex pattern for valid RPM package names.
2828 # Breakdown:
@@ -42,25 +42,26 @@ Describe "Linux Package Name Validation" {
4242 Write-Warning " $ ( $package.Name ) is not a valid RPM package name"
4343 }
4444 }
45-
45+
4646 if ($invalidPackages.Count -gt 0 ) {
4747 throw ($invalidPackages | Out-String )
4848 }
4949 }
5050 }
51-
51+
5252 Context " DEB Package Names" {
5353 It " Should have valid DEB package names" {
5454 $debPackages = Get-ChildItem - Path $artifactsDir - Recurse - Filter * .deb - ErrorAction SilentlyContinue
55-
55+
5656 $debPackages.Count | Should - BeGreaterThan 0 - Because " At least one DEB package should exist in the artifacts directory"
57-
57+
5858 $invalidPackages = @ ()
5959 # Regex pattern for valid DEB package names.
6060 # Valid examples:
6161 # - powershell-preview_7.6.0-preview.6-1.deb_amd64.deb
6262 # - powershell-lts_7.4.13-1.deb_amd64.deb
6363 # - powershell_7.4.13-1.deb_amd64.deb
64+ # - powershell_7.6.0-1.deb_arm64.deb
6465 # Breakdown:
6566 # ^powershell : Starts with 'powershell'
6667 # (-preview|-lts)? : Optionally '-preview' or '-lts'
@@ -78,19 +79,19 @@ Describe "Linux Package Name Validation" {
7879 Write-Warning " $ ( $package.Name ) is not a valid DEB package name"
7980 }
8081 }
81-
82+
8283 if ($invalidPackages.Count -gt 0 ) {
8384 throw ($invalidPackages | Out-String )
8485 }
8586 }
8687 }
87-
88+
8889 Context " Tar.Gz Package Names" {
8990 It " Should have valid tar.gz package names" {
9091 $tarPackages = Get-ChildItem - Path $artifactsDir - Recurse - Filter * .tar.gz - ErrorAction SilentlyContinue
91-
92+
9293 $tarPackages.Count | Should - BeGreaterThan 0 - Because " At least one tar.gz package should exist in the artifacts directory"
93-
94+
9495 $invalidPackages = @ ()
9596 foreach ($package in $tarPackages ) {
9697 # Pattern matches: powershell-7.6.0-preview.6-linux-x64.tar.gz or powershell-7.6.0-linux-x64.tar.gz
@@ -100,17 +101,17 @@ Describe "Linux Package Name Validation" {
100101 Write-Warning " $ ( $package.Name ) is not a valid tar.gz package name"
101102 }
102103 }
103-
104+
104105 if ($invalidPackages.Count -gt 0 ) {
105106 throw ($invalidPackages | Out-String )
106107 }
107108 }
108109 }
109-
110+
110111 Context " Package Existence" {
111112 It " Should find at least one package in artifacts directory" {
112113 $allPackages = Get-ChildItem - Path $artifactsDir - Recurse - Include * .rpm, * .tar.gz, * .deb - ErrorAction SilentlyContinue
113-
114+
114115 $allPackages.Count | Should - BeGreaterThan 0 - Because " At least one package should exist in the artifacts directory"
115116 }
116117 }
0 commit comments