Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 34 additions & 7 deletions .github/workflows/Action-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,63 @@ on: [pull_request]

jobs:
ActionTestDefault:
name: Action-Test - [Default]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shell: [pwsh]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- shell: powershell
os: windows-latest
name: Action-Test - [Default] - [${{ matrix.os }}@${{ matrix.shell }}]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Action-Test
uses: ./
with:
Shell: ${{ matrix.shell }}

ActionTestPrerelease:
name: Action-Test - [Prerelease]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shell: [pwsh]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- shell: powershell
os: windows-latest
name: Action-Test - [Prerelease] - [${{ matrix.os }}@${{ matrix.shell }}]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Action-Test
uses: ./
with:
Shell: ${{ matrix.shell }}
Prerelease: true

ActionTestVersion:
name: Action-Test - [Version]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shell: [pwsh]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- shell: powershell
os: windows-latest
name: Action-Test - [Version] - [${{ matrix.os }}@${{ matrix.shell }}]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Action-Test
uses: ./
with:
Shell: ${{ matrix.shell }}
Version: '[0.1,0.2]'
Prerelease: true
1 change: 1 addition & 0 deletions .github/workflows/Linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ jobs:
uses: github/super-linter@latest
env:
GITHUB_TOKEN: ${{ github.token }}
VALIDATE_JSCPD: false
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ The action can be configured using the following settings:
| --- | --- | --- | --- |
| Version | The version of the Utilities module to install. | '' (latest) | false |
| Prerelease | Whether to install prerelease versions of the Utilities module. | false | false |
| Shell | The shell to use for running the tests. | pwsh | false |

## Example

Expand All @@ -68,3 +69,14 @@ jobs:
## Permissions

The action does not require any permissions.

## Compatibility

The action is compatible with the following configurations:

| OS | Shell |
| --- | --- |
| windows-latest | pwsh |
| windows-latest | powershell |
| macos-latest | pwsh |
| ubuntu-latest | pwsh |
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@ inputs:
description: Whether to install prerelease versions of the Utilities module.
required: false
default: 'false'
Shell:
description: The shell to use for running the tests.
required: false
default: pwsh

runs:
using: composite
steps:
- name: Run Initialize-PSModule
shell: pwsh
shell: ${{ inputs.Shell }}
env:
GITHUB_ACTION_INPUT_Version: ${{ inputs.Version }}
GITHUB_ACTION_INPUT_Prerelease: ${{ inputs.Prerelease }}
run: |
# Initialize-PSModule
Write-Host '::group::Loading modules'
Install-Module -Name 'Microsoft.PowerShell.PSResourceGet' -Force -Verbose
Import-Module -Name 'Microsoft.PowerShell.PSResourceGet' -Force -Verbose
$params = @{
Name = 'Utilities'
Repository = 'PSGallery'
Expand Down
2 changes: 1 addition & 1 deletion scripts/main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Install-PSResource -Name 'powershell-yaml', 'PSSemVer', 'Pester', 'PSScriptAnaly
Stop-LogGroup

Start-LogGroup 'Loading helper scripts'
Get-ChildItem -Path (Join-Path -Path $env:GITHUB_ACTION_PATH -ChildPath 'scripts' 'helpers') -Filter '*.ps1' -Recurse |
Get-ChildItem -Path (Join-Path -Path $env:GITHUB_ACTION_PATH -ChildPath 'scripts\helpers') -Filter '*.ps1' -Recurse |
ForEach-Object { Write-Verbose "[$($_.FullName)]"; . $_.FullName }
Stop-LogGroup

Expand Down