diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 65c2de1..11014cf 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -6,18 +6,36 @@ 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 @@ -25,11 +43,20 @@ jobs: - 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 @@ -37,5 +64,5 @@ jobs: - name: Action-Test uses: ./ with: + Shell: ${{ matrix.shell }} Version: '[0.1,0.2]' - Prerelease: true diff --git a/.github/workflows/Linter.yml b/.github/workflows/Linter.yml index 89ac29a..7681f0e 100644 --- a/.github/workflows/Linter.yml +++ b/.github/workflows/Linter.yml @@ -16,3 +16,4 @@ jobs: uses: github/super-linter@latest env: GITHUB_TOKEN: ${{ github.token }} + VALIDATE_JSCPD: false diff --git a/README.md b/README.md index d763438..d0963ae 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 | diff --git a/action.yml b/action.yml index 8e1bda3..2db4bc2 100644 --- a/action.yml +++ b/action.yml @@ -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' diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 697a941..a8b92ac 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -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