-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
69 additions
and
4 deletions.
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,53 @@ | ||
name: CI Tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
ci: | ||
name: pester | ||
strategy: | ||
matrix: | ||
os: [ windows-latest, macos-latest, ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
DOTNET_NOLOGO: true | ||
DOTNET_GENERATE_ASPNET_CERTIFICATE: false | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dotnet | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
cache: true | ||
cache-dependency-path: '**/*.csproj' | ||
|
||
- name: Install PSResources | ||
run: ./tools/installPSResources.ps1 | ||
shell: pwsh | ||
|
||
- name: Build | ||
run: ./build.ps1 -Configuration Release -All | ||
shell: pwsh | ||
|
||
- name: Test | ||
run: ./build.ps1 -Test | ||
shell: pwsh | ||
|
||
- name: Test Windows PowerShell | ||
run: | | ||
Install-Module Pester -Scope CurrentUser -Force -SkipPublisherCheck | ||
./build.ps1 -Test | ||
if: matrix.os == 'windows-latest' | ||
shell: powershell | ||
|
||
- name: Upload test results | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: PSScriptAnalyzer-tests-${{ matrix.os }} | ||
path: testResults.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<packageSources> | ||
<clear /> | ||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> | ||
<add key="PowerShellCore_PublicPackages" value="https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v3/index.json" /> | ||
</packageSources> | ||
</configuration> |
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 platyPS -Scope CurrentUser | ||
Install-Module -Name Pester -Scope CurrentUser |