Skip to content

Commit 474b396

Browse files
author
Luis Orta
committed
Man I changes too much at once.
1 parent 0f4fc8e commit 474b396

File tree

11 files changed

+54
-4
lines changed

11 files changed

+54
-4
lines changed

.github/workflows/static.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ jobs:
3333
uses: actions/checkout@v4
3434
- name: Setup Pages
3535
uses: actions/configure-pages@v5
36+
- name: Test PowerShell Code
37+
shell: pwsh
38+
run: ./Tests/Test-PowerShell.ps1
39+
- name: Test MarkDown Files
40+
shell: pwsh
41+
run: ./Tests/Test-MarkDown.ps1
3642
- name: Build Pages
3743
shell: pwsh
3844
run: ./build.ps1

Tests/Test-MarkDown.ps1

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Requires
2+
# Description: This script tests the markdown files in the repository.
3+
# Author: Luis
4+
5+
#Set the current location
6+
Set-Location $PSScriptRoot
7+
8+
#This test is about making sure there aren't easily fixed mistakes in the markdown files.
9+
Write-Host "Starting Pester Tests"
10+
11+
Describe 'CheckMarkdownSyntax' {
12+
It 'Should be valid markdown code' {
13+
$Scripts = Get-ChildItem ..\*.md -Recurse
14+
foreach ($ScriptFile in $Scripts){
15+
Write-Host "Checking File $ScriptFile"
16+
ConvertFrom-Markdown -Path $ScriptFile -ErrorAction Stop
17+
}
18+
}
19+
}

Tests/Test-PowerShell.ps1

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Requires
2+
# Description: This script tests the powershell scripts in the repository.
3+
# Author: Luis
4+
5+
#Set the current location
6+
Set-Location $PSScriptRoot
7+
8+
#This test is about making sure there aren't easily fixed mistakes in our powershell code bases.
9+
Write-Host "Starting Pester Tests"
10+
11+
Describe 'CheckPowerShellSyntax' {
12+
It 'Should be valid powershell code' {
13+
$Scripts = Get-ChildItem ..\*.ps1 -Recurse
14+
foreach ($ScriptFile in $Scripts){
15+
Write-Host "Checking File $ScriptFile"
16+
#Create the variables and pass the code to the parser. Then if there's any errors, return an an error.
17+
$tokens = $errors = $null
18+
[System.Management.Automation.Language.Parser]::ParseFile($ScriptFile, [ref]$tokens, [ref]$errors)
19+
if ($errors) {
20+
Write-Error "Test has Failed"
21+
}
22+
}
23+
}
24+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

Website/index.html.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Set-Location $PSScriptRoot
2+
$title = "Coders Unite!"
3+
(ConvertFrom-Markdown -Path .\Content\AboutUs.md).html
File renamed without changes.

build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ if ($lastBuild) {
5757

5858
# Save the build time to a file.
5959
$newLastBuild | ConvertTo-Json -Depth 2 > lastBuild.json
60-
#endregion lastBuild.json
60+
# endregion lastBuild.json
6161

6262
# Create an archive of the current deployment.
6363
Compress-Archive -Path $pwd -DestinationPath "archive.zip" -CompressionLevel Optimal -Force
6464

65-
Pop-Location
65+
Pop-Location

0 commit comments

Comments
 (0)