From 88c0cf0bd15a114ad3f5a1e712ab961057993d53 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 24 Mar 2024 00:54:35 +0100 Subject: [PATCH 01/12] Added param for shell type --- README.md | 1 + action.yml | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d763438..63fd9d8 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 diff --git a/action.yml b/action.yml index 8e1bda3..64822df 100644 --- a/action.yml +++ b/action.yml @@ -13,12 +13,16 @@ 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 }} From fe3af68a376023c832b3d65f684838b6b35c56c5 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 24 Mar 2024 00:57:27 +0100 Subject: [PATCH 02/12] test --- .github/workflows/Action-Test.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 65c2de1..d112464 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -6,7 +6,16 @@ on: [pull_request] jobs: ActionTestDefault: - name: Action-Test - [Default] + 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 }} runs-on: ubuntu-latest steps: - name: Checkout repo From c31970f7968343cfe1f6cedf551b47b8de37617a Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 24 Mar 2024 01:00:20 +0100 Subject: [PATCH 03/12] test --- .github/workflows/Action-Test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index d112464..60365a5 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -16,7 +16,6 @@ jobs: os: windows-latest name: Action-Test - [Default] - [${{ matrix.os }}@${{ matrix.shell }}] runs-on: ${{ matrix.os }} - runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v4 From 6977e1dd53847c00ee9600f86cedab67e0e03544 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 24 Mar 2024 01:00:40 +0100 Subject: [PATCH 04/12] test --- .github/workflows/Action-Test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 60365a5..9f63404 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -22,6 +22,8 @@ jobs: - name: Action-Test uses: ./ + with: + Shell: ${{ matrix.shell }} ActionTestPrerelease: name: Action-Test - [Prerelease] From 3eb539030bd128ae9ab47c46bf493a590c2399af Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 24 Mar 2024 01:04:14 +0100 Subject: [PATCH 05/12] test --- action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action.yml b/action.yml index 64822df..2db4bc2 100644 --- a/action.yml +++ b/action.yml @@ -29,6 +29,8 @@ runs: 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' From b87d1b4dbe2aac6db0f9e5a00496dc1985d23c24 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 24 Mar 2024 10:07:24 +0100 Subject: [PATCH 06/12] tests --- scripts/main.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 697a941..4ce2fb8 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -7,7 +7,9 @@ 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 | +$scripts = Join-Path -Path $env:GITHUB_ACTION_PATH -ChildPath 'scripts' +$helpers = Join-Path -Path $scripts -ChildPath 'helpers' +Get-ChildItem -Path $helpers -Filter '*.ps1' -Recurse | ForEach-Object { Write-Verbose "[$($_.FullName)]"; . $_.FullName } Stop-LogGroup From 73fee70e0c4850982356301199c217598da4e32c Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 24 Mar 2024 10:14:54 +0100 Subject: [PATCH 07/12] Fix --- scripts/main.ps1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 4ce2fb8..a8b92ac 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -7,9 +7,7 @@ Install-PSResource -Name 'powershell-yaml', 'PSSemVer', 'Pester', 'PSScriptAnaly Stop-LogGroup Start-LogGroup 'Loading helper scripts' -$scripts = Join-Path -Path $env:GITHUB_ACTION_PATH -ChildPath 'scripts' -$helpers = Join-Path -Path $scripts -ChildPath 'helpers' -Get-ChildItem -Path $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 From 033263071989130cd323ece9b44aca1b0b1fe72c Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 24 Mar 2024 10:20:33 +0100 Subject: [PATCH 08/12] test --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 63fd9d8..d0963ae 100644 --- a/README.md +++ b/README.md @@ -69,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 | From 0358d2d6326f43f5ce58bd31e14092526b6e7bd2 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 24 Mar 2024 10:28:08 +0100 Subject: [PATCH 09/12] test --- .github/workflows/Action-Test.yml | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 9f63404..575e8b9 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -26,8 +26,16 @@ jobs: 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 @@ -35,11 +43,19 @@ jobs: - name: Action-Test uses: ./ with: - Prerelease: true + Shell: ${{ matrix.shell }} 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 @@ -47,5 +63,4 @@ jobs: - name: Action-Test uses: ./ with: - Version: '[0.1,0.2]' - Prerelease: true + Shell: ${{ matrix.shell }} From 23eb82ff366f1afe11eae2d33a26171b39555c0b Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 24 Mar 2024 10:36:08 +0100 Subject: [PATCH 10/12] test --- .github/workflows/Action-Test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 575e8b9..11014cf 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -44,6 +44,7 @@ jobs: uses: ./ with: Shell: ${{ matrix.shell }} + Prerelease: true ActionTestVersion: strategy: @@ -64,3 +65,4 @@ jobs: uses: ./ with: Shell: ${{ matrix.shell }} + Version: '[0.1,0.2]' From d4d5b32fe7d1d3684aff5211b0f8c54402cb2008 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 24 Mar 2024 10:39:12 +0100 Subject: [PATCH 11/12] test --- .github/workflows/Action-Test.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 11014cf..ba7a39a 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -17,9 +17,6 @@ jobs: 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: @@ -37,9 +34,6 @@ jobs: 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: @@ -58,9 +52,6 @@ jobs: 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: From 7f5112c493a8183b56f8c11c71ddf7d1be7efbcf Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 24 Mar 2024 10:41:18 +0100 Subject: [PATCH 12/12] fix --- .github/workflows/Action-Test.yml | 9 +++++++++ .github/workflows/Linter.yml | 1 + 2 files changed, 10 insertions(+) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index ba7a39a..11014cf 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -17,6 +17,9 @@ jobs: 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: @@ -34,6 +37,9 @@ jobs: 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: @@ -52,6 +58,9 @@ jobs: 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: 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