-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Action based CI tests (#220)
- Loading branch information
1 parent
47bc3b7
commit 0391ffb
Showing
5 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: CI Tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ main ] | ||
merge_group: | ||
types: [ checks_requested ] | ||
|
||
jobs: | ||
ci: | ||
name: pester | ||
strategy: | ||
matrix: | ||
os: [ windows-latest, macos-latest, ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
DOTNET_NOLOGO: true | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
DOTNET_GENERATE_ASPNET_CERTIFICATE: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.x | ||
- run: ./tools/installPSResources.ps1 | ||
shell: pwsh | ||
- run: ./build.ps1 -Build && Invoke-ModuleTests -Type Functional | ||
shell: pwsh | ||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: SecretManagement-package-${{ matrix.os }} | ||
path: out/**/*.nupkg | ||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: SecretManagement-tests-${{ matrix.os }} | ||
path: test/result.pester.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
$ErrorActionPreference = 'Stop' | ||
|
||
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | Out-Null | ||
if ($PSVersionTable.PSVersion.Major -lt 6) { | ||
throw "The build script requires PowerShell 7!" | ||
} | ||
|
||
# TODO: Switch to Install-PSResource when CI uses PowerShell 7.4 | ||
Install-Module -Name PowerShellGet -AllowPrerelease -Scope CurrentUser -Force | ||
Install-Module -Name Pester -RequiredVersion 4.10.1 -Scope CurrentUser -Force |