-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
748b99d
commit 3d50eca
Showing
8 changed files
with
201 additions
and
2 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,25 @@ | ||
########################### | ||
## Markdown Linter rules ## | ||
########################### | ||
|
||
# Linter rules doc: | ||
# - https://github.com/DavidAnson/markdownlint | ||
|
||
############### | ||
# Rules by id # | ||
############### | ||
MD004: false # Unordered list style | ||
MD007: | ||
indent: 2 # Unordered list indentation | ||
MD013: | ||
line_length: 808 # Line length | ||
MD026: | ||
punctuation: ".,;:!。,;:" # List of not allowed | ||
MD029: false # Ordered list item prefix | ||
MD033: false # Allow inline HTML | ||
MD036: false # Emphasis used instead of a heading | ||
|
||
################# | ||
# Rules by tags # | ||
################# | ||
blank_lines: false # Error on blank lines |
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,17 @@ | ||
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes | ||
|
||
changelog: | ||
categories: | ||
- title: Breaking Changes | ||
labels: | ||
- Major | ||
- Breaking | ||
- title: New Features | ||
labels: | ||
- Minor | ||
- Feature | ||
- Improvement | ||
- Enhancement | ||
- title: Other Changes | ||
labels: | ||
- '*' |
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,23 @@ | ||
name: Verify Action | ||
|
||
on: | ||
workflow_call: | ||
push: | ||
paths: | ||
- action.yml | ||
- .github/workflows/Action-Test.yml | ||
- scripts/** | ||
|
||
jobs: | ||
DefaultTest: | ||
name: Test Action - [Default] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Initialize environment | ||
uses: PSModule/Initialize-PSModule@main | ||
|
||
- name: Test local action | ||
uses: ./ |
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,27 @@ | ||
name: Auto-Release | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- closed | ||
- opened | ||
- reopened | ||
- synchronize | ||
- labeled | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
||
jobs: | ||
Auto-Release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Auto-Release | ||
uses: PSModule/Auto-Release@v1 | ||
env: | ||
GH_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication |
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,17 @@ | ||
name: Linter | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
Lint: | ||
name: Lint code base | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Lint code base | ||
uses: github/super-linter@latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,11 @@ | ||
## Ignore Visual Studio Code temporary files, build results, and | ||
## files generated by popular Visual Studio Code add-ons. | ||
## | ||
## Get latest from https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/extensions.json | ||
*.code-workspace | ||
|
||
# Local History for Visual Studio Code | ||
.history/ |
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,2 +1,11 @@ | ||
# test | ||
Action that is used to test PowerShell modules | ||
# Test-Module | ||
|
||
Action that is used to test PowerShell modules. | ||
|
||
## Tools | ||
|
||
- [PSScriptAnalyzer | PS Gallery](https://www.powershellgallery.com/packages/PSScriptAnalyzer/) | ||
- [PowerShell Core | Microsoft Learn](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/test-modulemanifest) | ||
- [PowerShellGet | Microsoft Learn](https://learn.microsoft.com/en-us/powershell/module/PowerShellGet/test-scriptfileinfo) | ||
- [pester.dev](https://www.pester.dev) | ||
- [Pester | GitHub](https://github.com/Pester/Pester) |
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,70 @@ | ||
name: 'Test-PSModule' | ||
description: 'Test a PowerShell module before publishing the module to the PowerShell Gallery.' | ||
branding: | ||
icon: activity | ||
color: blue | ||
|
||
inputs: | ||
Name: | ||
description: 'The name of the module to build.' | ||
required: false | ||
default: '*' | ||
Path: | ||
description: 'The path to the module to build.' | ||
required: false | ||
default: 'outputs' | ||
CustomTestsPath: | ||
description: 'The path to the custom tests to run.' | ||
required: false | ||
default: $null | ||
ErrorAction: | ||
description: 'The action to take if an error occurs.' | ||
required: false | ||
default: 'Stop' | ||
Verbose: | ||
description: 'Enable verbose output.' | ||
required: false | ||
default: 'true' | ||
WhatIf: | ||
description: 'Run in WhatIf mode.' | ||
required: false | ||
default: 'false' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Run Test-PSModule | ||
shell: pwsh | ||
run: | | ||
# Test-PSModule | ||
$ErrorActionPreference = '${{ inputs.ErrorAction }}' | ||
Write-Host '::group::Initializing...' | ||
Write-Output '-------------------------------------------' | ||
Write-Output 'Action inputs:' | ||
$params = @{ | ||
Name = "${{ inputs.Name }}" | ||
Path = Join-Path $env:GITHUB_WORKSPACE '${{ inputs.Path }}' | ||
Verbose = [System.Convert]::ToBoolean('${{ inputs.Verbose }}') | ||
WhatIf = [System.Convert]::ToBoolean('${{ inputs.WhatIf }}') | ||
ErrorAction = $ErrorActionPreference | ||
} | ||
if (-not [string]::IsNullOrEmpty("${{ inputs.CustomTestsPath }}")) { | ||
$params['CustomTestsPath'] = Join-Path $env:GITHUB_WORKSPACE "${{ inputs.CustomTestsPath }}" | ||
} | ||
$params.GetEnumerator() | Sort-Object -Property Name | ||
Write-Host '::endgroup::' | ||
try { | ||
$failedTests = Test-PSModule @params | ||
} catch { | ||
Write-Host "::error::$_" | ||
exit 1 | ||
} | ||
if ($ErrorActionPreference -like '*Continue') { | ||
Write-Host '::warning::Errors were ignored.' | ||
return | ||
} |