Skip to content

Commit

Permalink
feat: added github actions baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
scrthq committed Jan 11, 2024
1 parent 465a4f7 commit d70a279
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 15 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build-test-deploy-powershell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,66 @@ jobs:
with:
name: BuildOutput
path: BuildOutput

test_ubu:
name: Test Ubuntu
runs-on: ubuntu-latest
needs:
- build
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download BuildOutput directory
uses: actions/download-artifact@v4
with:
name: BuildOutput
path: BuildOutput

- name: Test Module
shell: pwsh
run: |
. ./build.ps1 -Task Test
test_win:
name: Test Windows
runs-on: windows-latest
needs:
- build
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download BuildOutput directory
uses: actions/download-artifact@v4
with:
name: BuildOutput
path: BuildOutput

- name: Test Module
shell: pwsh
run: |
. ./build.ps1 -Task Test
test_mac:
name: Test MacOS
runs-on: macos-latest
needs:
- build
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download BuildOutput directory
uses: actions/download-artifact@v4
with:
name: BuildOutput
path: BuildOutput

- name: Test Module
shell: pwsh
run: |
. ./build.ps1 -Task Test
32 changes: 17 additions & 15 deletions Tests/3. Integration Tests/PSGSuite.Integration.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
if ($ENV:BUILD_BUILDURI -like 'vstfs:*' -and -not [String]::IsNullOrEmpty($env:PSGSuiteConfigJson)) {
$projectRoot = Resolve-Path "$PSScriptRoot\..\.."
$ModulePath = Resolve-Path "$projectRoot\BuildOutput\$($env:BHProjectName)"
$decompiledModulePath = Resolve-Path "$projectRoot\$($env:BHProjectName)"
# if ($ENV:BUILD_BUILDURI -like 'vstfs:*' -and -not [String]::IsNullOrEmpty($env:PSGSuiteConfigJson)) {
# $projectRoot = Resolve-Path "$PSScriptRoot\..\.."
# $ModulePath = Resolve-Path "$projectRoot\BuildOutput\$($env:BHProjectName)"
# $decompiledModulePath = Resolve-Path "$projectRoot\$($env:BHProjectName)"

$Verbose = @{}
if ($ENV:BHBranchName -eq "development" -or $env:BHCommitMessage -match "!verbose") {
$Verbose.add("Verbose",$True)
}
$moduleRoot = Split-Path (Resolve-Path "$ModulePath\*\*.psd1")
# $Verbose = @{}
# if ($ENV:BHBranchName -eq "development" -or $env:BHCommitMessage -match "!verbose") {
# $Verbose.add("Verbose",$True)
# }
# $moduleRoot = Split-Path (Resolve-Path "$ModulePath\*\*.psd1")

Import-Module $ModulePath -Force -Verbose:$false
Import-PSGSuiteConfig -Json $env:PSGSuiteConfigJson -Temporary -Verbose
# Import-Module $ModulePath -Force -Verbose:$false
# Import-PSGSuiteConfig -Json $env:PSGSuiteConfigJson -Temporary -Verbose

# $u = Get-GSUser
# $u | Select-Object @{N="GivenName";E={$_.Name.GivenName}},OrgUnitPath,Kind

# Send-GmailMessage -From $u.PrimaryEmail -To $u.PrimaryEmail -Subject "Hello from Azure Pipelines + PS Version $($PSVersionTable.PSVersion.ToString())!" -Body "<pre>`n$((Get-ChildItem Env: | Where-Object {$_.Name -match '^(BUILD_|BH).*$'} | Format-Table -AutoSize | Out-String).Trim())`n</pre>" -BodyAsHtml -Verbose
# }

$u = Get-GSUser
$u | Select-Object @{N="GivenName";E={$_.Name.GivenName}},OrgUnitPath,Kind

Send-GmailMessage -From $u.PrimaryEmail -To $u.PrimaryEmail -Subject "Hello from Azure Pipelines + PS Version $($PSVersionTable.PSVersion.ToString())!" -Body "<pre>`n$((Get-ChildItem Env: | Where-Object {$_.Name -match '^(BUILD_|BH).*$'} | Format-Table -AutoSize | Out-String).Trim())`n</pre>" -BodyAsHtml -Verbose
}
<#
Describe "Function contents" -Tag 'Module' {
Context "Get-GSUser should return a user" {
Expand Down

0 comments on commit d70a279

Please sign in to comment.