From 366bf85e0cbc0efb51780593ce1f78ab01544d9e Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Wed, 27 Mar 2024 23:53:59 +0100 Subject: [PATCH 01/29] tests --- .github/workflows/Auto-Release.yml | 1 + .github/workflows/Linter.yml | 4 + .github/workflows/Workflow-Test.yml | 4 + .github/workflows/testmodule.yml | 47 ++++++++ .github/workflows/tmp.yml | 37 ++++++ .github/workflows/workflow.yml | 175 +++++++++++++++++++++++++--- 6 files changed, 253 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/testmodule.yml create mode 100644 .github/workflows/tmp.yml diff --git a/.github/workflows/Auto-Release.yml b/.github/workflows/Auto-Release.yml index 4734f273..05d63b4a 100644 --- a/.github/workflows/Auto-Release.yml +++ b/.github/workflows/Auto-Release.yml @@ -15,6 +15,7 @@ on: concurrency: group: ${{ github.workflow }} + cancel-in-progress: true permissions: contents: write diff --git a/.github/workflows/Linter.yml b/.github/workflows/Linter.yml index cfd32e6e..fd491ea5 100644 --- a/.github/workflows/Linter.yml +++ b/.github/workflows/Linter.yml @@ -4,6 +4,10 @@ run-name: "Linter - [${{ github.event.pull_request.title }} #${{ github.event.pu on: [pull_request] +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + permissions: contents: read packages: read diff --git a/.github/workflows/Workflow-Test.yml b/.github/workflows/Workflow-Test.yml index 4fd5cbf8..76f63604 100644 --- a/.github/workflows/Workflow-Test.yml +++ b/.github/workflows/Workflow-Test.yml @@ -4,6 +4,10 @@ run-name: "Workflow-Test - [${{ github.event.pull_request.title }} #${{ github.e on: [pull_request] +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + permissions: contents: write pull-requests: write diff --git a/.github/workflows/testmodule.yml b/.github/workflows/testmodule.yml new file mode 100644 index 00000000..3be0db18 --- /dev/null +++ b/.github/workflows/testmodule.yml @@ -0,0 +1,47 @@ +name: Test-Module + +on: + workflow_call: + inputs: + OS: + type: string + description: The operating system to use for the build and test jobs. + required: true + Shell: + type: string + description: The shell to use for the build and test jobs. + required: true + +jobs: + TestModule: + name: Test module (${{ inputs.Shell }}@${{ inputs.OS }}) + runs-on: ${{ inputs.OS }} + outputs: + passed: ${{ steps.test.outputs.passed }} + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Initialize environment + uses: PSModule/Initialize-PSModule@v1 + with: + Version: ${{ inputs.Version }} + Prerelease: ${{ inputs.Prerelease }} + Shell: ${{ inputs.Shell }} + + - name: Download module artifact + uses: actions/download-artifact@v4 + with: + name: module + path: ${{ inputs.ModulesOutputPath }} + + - name: Test built module + id: test + uses: PSModule/Test-PSModule@v1 + if: ${{ inputs.SkipTests != true }} + continue-on-error: true + with: + Name: ${{ inputs.Name }} + Path: ${{ inputs.ModulesOutputPath }} + Shell: ${{ inputs.Shell }} + TestType: Module diff --git a/.github/workflows/tmp.yml b/.github/workflows/tmp.yml new file mode 100644 index 00000000..b944064e --- /dev/null +++ b/.github/workflows/tmp.yml @@ -0,0 +1,37 @@ + TestModule: + name: Test module + needs: BuildModule + strategy: + fail-fast: false + matrix: + shell: [pwsh] + os: [ubuntu-latest, macos-latest, windows-latest] + include: + - shell: powershell + os: windows-latest + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Initialize environment + uses: PSModule/Initialize-PSModule@v1 + with: + Version: ${{ inputs.Version }} + Prerelease: ${{ inputs.Prerelease }} + Shell: ${{ matrix.shell }} + + - name: Download module artifact + uses: actions/download-artifact@v4 + with: + name: module + path: ${{ inputs.ModulesOutputPath }} + + - name: Test built module + uses: PSModule/Test-PSModule@v1 + if: ${{ inputs.SkipTests != true }} + with: + Name: ${{ inputs.Name }} + Path: ${{ inputs.ModulesOutputPath }} + Shell: ${{ matrix.shell }} + TestType: 'Module' diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 82505e11..996e602c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -84,7 +84,7 @@ jobs: Name: ${{ inputs.Name }} Path: ${{ inputs.Path }} Shell: ${{ matrix.shell }} - TestType: 'SourceCode' + TestType: SourceCode BuildModule: name: Build module @@ -124,18 +124,13 @@ jobs: if-no-files-found: error retention-days: 1 - TestModule: - name: Test module + #This is necessary as there is no way to get output from a matrix job + TestModule-pwsh-ubuntu-latest: + name: Test module (pwsh@ubuntu-latest) needs: BuildModule - strategy: - fail-fast: false - matrix: - shell: [pwsh] - os: [ubuntu-latest, macos-latest, windows-latest] - include: - - shell: powershell - os: windows-latest - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest + outputs: + passed: ${{ steps.test.outputs.passed }} steps: - name: Checkout Code uses: actions/checkout@v4 @@ -145,7 +140,7 @@ jobs: with: Version: ${{ inputs.Version }} Prerelease: ${{ inputs.Prerelease }} - Shell: ${{ matrix.shell }} + Shell: pwsh - name: Download module artifact uses: actions/download-artifact@v4 @@ -154,14 +149,164 @@ jobs: path: ${{ inputs.ModulesOutputPath }} - name: Test built module - uses: PSModule/Test-PSModule@v1 + id: test + uses: PSModule/Test-PSModule@tests if: ${{ inputs.SkipTests != true }} + continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} - Shell: ${{ matrix.shell }} + Shell: pwsh + TestType: Module + + TestModule-pwsh-macos-latest: + name: Test module (pwsh@macos-latest) + needs: BuildModule + runs-on: macos-latest + outputs: + passed: ${{ steps.test.outputs.passed }} + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Initialize environment + uses: PSModule/Initialize-PSModule@v1 + with: + Version: ${{ inputs.Version }} + Prerelease: ${{ inputs.Prerelease }} + Shell: pwsh + + - name: Download module artifact + uses: actions/download-artifact@v4 + with: + name: module + path: ${{ inputs.ModulesOutputPath }} + + - name: Test built module + id: test + uses: PSModule/Test-PSModule@tests + if: ${{ inputs.SkipTests != true }} + continue-on-error: true + with: + Name: ${{ inputs.Name }} + Path: ${{ inputs.ModulesOutputPath }} + Shell: pwsh + TestType: 'Module' + + TestModule-pwsh-windows-latest: + name: Test module (pwsh@windows-latest) + needs: BuildModule + runs-on: windows-latest + outputs: + passed: ${{ steps.test.outputs.passed }} + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Initialize environment + uses: PSModule/Initialize-PSModule@v1 + with: + Version: ${{ inputs.Version }} + Prerelease: ${{ inputs.Prerelease }} + Shell: pwsh + + - name: Download module artifact + uses: actions/download-artifact@v4 + with: + name: module + path: ${{ inputs.ModulesOutputPath }} + + - name: Test built module + id: test + uses: PSModule/Test-PSModule@tests + if: ${{ inputs.SkipTests != true }} + continue-on-error: true + with: + Name: ${{ inputs.Name }} + Path: ${{ inputs.ModulesOutputPath }} + Shell: pwsh TestType: 'Module' + TestModule-powershell-windows-latest: + name: Test module (powershell@windows-latest) + needs: BuildModule + runs-on: windows-latest + outputs: + passed: ${{ steps.test.outputs.passed }} + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Initialize environment + uses: PSModule/Initialize-PSModule@v1 + with: + Version: ${{ inputs.Version }} + Prerelease: ${{ inputs.Prerelease }} + Shell: powershell + + - name: Download module artifact + uses: actions/download-artifact@v4 + with: + name: module + path: ${{ inputs.ModulesOutputPath }} + + - name: Test built module + id: test + uses: PSModule/Test-PSModule@tests + if: ${{ inputs.SkipTests != true }} + continue-on-error: true + with: + Name: ${{ inputs.Name }} + Path: ${{ inputs.ModulesOutputPath }} + Shell: powershell + TestType: 'Module' + + TestModule: + name: Test module + needs: + - TestModule-pwsh-ubuntu-latest + - TestModule-pwsh-macos-latest + - TestModule-pwsh-windows-latest + - TestModule-powershell-windows-latest + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Download module artifact + uses: actions/download-artifact@v4 + with: + name: module + path: ${{ inputs.ModulesOutputPath }} + + - name: Summerize tests + shell: pwsh + run: | + $Linux = '${{ needs.TestModule-pwsh-ubuntu-latest.outputs.passed }}' -eq 'true' + $MacOS = '${{ needs.TestModule-pwsh-macos-latest.outputs.passed }}' -eq 'true' + $Windows = '${{ needs.TestModule-pwsh-windows-latest.outputs.passed }}' -eq 'true' + $Desktop = '${{ needs.TestModule-powershell-windows-latest.outputs.passed }}' -eq 'true' + $Core = $Linux -or $MacOS -or $Windows + + $Status = @{ + Linux = $Linux + MacOS = $MacOS + Windows = $Windows + Desktop = $Desktop + Core = $Core + } + + Write-Verbose "Status:" -Verbose + Write-Verbose ($Status | Out-String) -Verbose + + # - name: Upload module artifact + # uses: actions/upload-artifact@v4 + # with: + # name: module + # path: ${{ inputs.ModulesOutputPath }} + # if-no-files-found: error + # retention-days: 1 + LintDocs: name: Lint documentation needs: BuildModule From 4579459b32fa0b8e0c46ab10312453aa2affd549 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 00:29:23 +0100 Subject: [PATCH 02/29] test --- .github/workflows/tmp.yml | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .github/workflows/tmp.yml diff --git a/.github/workflows/tmp.yml b/.github/workflows/tmp.yml deleted file mode 100644 index b944064e..00000000 --- a/.github/workflows/tmp.yml +++ /dev/null @@ -1,37 +0,0 @@ - TestModule: - name: Test module - needs: BuildModule - strategy: - fail-fast: false - matrix: - shell: [pwsh] - os: [ubuntu-latest, macos-latest, windows-latest] - include: - - shell: powershell - os: windows-latest - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Initialize environment - uses: PSModule/Initialize-PSModule@v1 - with: - Version: ${{ inputs.Version }} - Prerelease: ${{ inputs.Prerelease }} - Shell: ${{ matrix.shell }} - - - name: Download module artifact - uses: actions/download-artifact@v4 - with: - name: module - path: ${{ inputs.ModulesOutputPath }} - - - name: Test built module - uses: PSModule/Test-PSModule@v1 - if: ${{ inputs.SkipTests != true }} - with: - Name: ${{ inputs.Name }} - Path: ${{ inputs.ModulesOutputPath }} - Shell: ${{ matrix.shell }} - TestType: 'Module' From ae3da8ac5cb100450678f3d4302098ab4e5d9d7d Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 00:51:58 +0100 Subject: [PATCH 03/29] test --- .github/workflows/workflow.yml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 996e602c..cafe02f6 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -56,7 +56,7 @@ permissions: jobs: TestSourceCode: - name: Test source code + name: Test code strategy: fail-fast: false matrix: @@ -126,7 +126,7 @@ jobs: #This is necessary as there is no way to get output from a matrix job TestModule-pwsh-ubuntu-latest: - name: Test module (pwsh@ubuntu-latest) + name: Test module (pwsh, ubuntu-latest) needs: BuildModule runs-on: ubuntu-latest outputs: @@ -160,7 +160,7 @@ jobs: TestType: Module TestModule-pwsh-macos-latest: - name: Test module (pwsh@macos-latest) + name: Test module (pwsh, macos-latest) needs: BuildModule runs-on: macos-latest outputs: @@ -194,7 +194,7 @@ jobs: TestType: 'Module' TestModule-pwsh-windows-latest: - name: Test module (pwsh@windows-latest) + name: Test module (pwsh, windows-latest) needs: BuildModule runs-on: windows-latest outputs: @@ -228,7 +228,7 @@ jobs: TestType: 'Module' TestModule-powershell-windows-latest: - name: Test module (powershell@windows-latest) + name: Test module (powershell, windows-latest) needs: BuildModule runs-on: windows-latest outputs: @@ -273,6 +273,12 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 + - name: Initialize environment + uses: PSModule/Initialize-PSModule@v1 + with: + Version: ${{ inputs.Version }} + Prerelease: ${{ inputs.Prerelease }} + - name: Download module artifact uses: actions/download-artifact@v4 with: @@ -299,13 +305,15 @@ jobs: Write-Verbose "Status:" -Verbose Write-Verbose ($Status | Out-String) -Verbose - # - name: Upload module artifact - # uses: actions/upload-artifact@v4 - # with: - # name: module - # path: ${{ inputs.ModulesOutputPath }} - # if-no-files-found: error - # retention-days: 1 + Get-ChildItem -Path $env:GITHUB_WORKSPACE -Recurse | Select-Object FullName | Sort-Object + + - name: Upload module artifact + uses: actions/upload-artifact@v4 + with: + name: module + path: ${{ inputs.ModulesOutputPath }} + if-no-files-found: error + retention-days: 1 LintDocs: name: Lint documentation From b7b1f05f90e80ea35e73d6c304b4d784b4d7ab38 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 01:32:29 +0100 Subject: [PATCH 04/29] fix --- .github/workflows/workflow.yml | 36 +++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index cafe02f6..afcf38e6 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -302,10 +302,39 @@ jobs: Core = $Core } - Write-Verbose "Status:" -Verbose - Write-Verbose ($Status | Out-String) -Verbose + Write-Host "Status" + Write-Host ($Status | Out-String) - Get-ChildItem -Path $env:GITHUB_WORKSPACE -Recurse | Select-Object FullName | Sort-Object + if (-not ($Core -or $Desktop)) { + Write-Host "::[error]::No tests passed" + exit 1 + } + + $moduleName = ('${{ inputs.Name }}' | IsNullOrEmpty) ? $env:GITHUB_REPOSITORY_NAME : $env:GITHUB_ACTION_INPUT_Name + $path = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "${{ inputs.ModulesOutputPath }}\$moduleName" + $moduleManifestPath = Join-Path -Path $Path -ChildPath "$moduleName.psd1" + + if ($Desktop) { + Add-ModuleManifest -Path $moduleManifestPath -CompatiblePSEditions 'Desktop' + Add-ModuleManifest -Path $moduleManifestPath -Tags 'PSEdition_Desktop' + } + + if ($Core) { + Add-ModuleManifest -Path $moduleManifestPath -CompatiblePSEditions 'Core' + Add-ModuleManifest -Path $moduleManifestPath -Tags 'PSEdition_Core' + } + + if ($Linux) { + Add-ModuleManifest -Path $moduleManifestPath -Tags 'Linux' + } + + if ($MacOS) { + Add-ModuleManifest -Path $moduleManifestPath -Tags 'MacOS' + } + + if ($Windows) { + Add-ModuleManifest -Path $moduleManifestPath -Tags 'Windows' + } - name: Upload module artifact uses: actions/upload-artifact@v4 @@ -314,6 +343,7 @@ jobs: path: ${{ inputs.ModulesOutputPath }} if-no-files-found: error retention-days: 1 + overwrite: true LintDocs: name: Lint documentation From 3c40ad7c4f8b9e98b41edae6e9a042ffb7df1b39 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 01:42:11 +0100 Subject: [PATCH 05/29] test --- .github/workflows/workflow.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index afcf38e6..1663ceda 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -310,30 +310,30 @@ jobs: exit 1 } - $moduleName = ('${{ inputs.Name }}' | IsNullOrEmpty) ? $env:GITHUB_REPOSITORY_NAME : $env:GITHUB_ACTION_INPUT_Name + $moduleName = [string]::IsNullOrEmpty('${{ inputs.Name }}') ? $env:GITHUB_REPOSITORY_NAME : $env:GITHUB_ACTION_INPUT_Name $path = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "${{ inputs.ModulesOutputPath }}\$moduleName" $moduleManifestPath = Join-Path -Path $Path -ChildPath "$moduleName.psd1" if ($Desktop) { - Add-ModuleManifest -Path $moduleManifestPath -CompatiblePSEditions 'Desktop' - Add-ModuleManifest -Path $moduleManifestPath -Tags 'PSEdition_Desktop' + Add-ModuleManifestData -Path $moduleManifestPath -CompatiblePSEditions 'Desktop' + Add-ModuleManifestData -Path $moduleManifestPath -Tags 'PSEdition_Desktop' } if ($Core) { - Add-ModuleManifest -Path $moduleManifestPath -CompatiblePSEditions 'Core' - Add-ModuleManifest -Path $moduleManifestPath -Tags 'PSEdition_Core' + Add-ModuleManifestData -Path $moduleManifestPath -CompatiblePSEditions 'Core' + Add-ModuleManifestData -Path $moduleManifestPath -Tags 'PSEdition_Core' } if ($Linux) { - Add-ModuleManifest -Path $moduleManifestPath -Tags 'Linux' + Add-ModuleManifestData -Path $moduleManifestPath -Tags 'Linux' } if ($MacOS) { - Add-ModuleManifest -Path $moduleManifestPath -Tags 'MacOS' + Add-ModuleManifestData -Path $moduleManifestPath -Tags 'MacOS' } if ($Windows) { - Add-ModuleManifest -Path $moduleManifestPath -Tags 'Windows' + Add-ModuleManifestData -Path $moduleManifestPath -Tags 'Windows' } - name: Upload module artifact From b1ae03c28fa4449ccdb65e4d1fcc70b5abb5f700 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 01:50:01 +0100 Subject: [PATCH 06/29] test --- .github/workflows/workflow.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 1663ceda..67f18bfe 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -295,25 +295,33 @@ jobs: $Core = $Linux -or $MacOS -or $Windows $Status = @{ - Linux = $Linux - MacOS = $MacOS - Windows = $Windows - Desktop = $Desktop - Core = $Core + Linux = $Linux + MacOS = $MacOS + Windows = $Windows + Desktop = $Desktop + Core = $Core } Write-Host "Status" Write-Host ($Status | Out-String) if (-not ($Core -or $Desktop)) { - Write-Host "::[error]::No tests passed" - exit 1 + Write-Host "::[error]::No tests passed" + exit 1 } $moduleName = [string]::IsNullOrEmpty('${{ inputs.Name }}') ? $env:GITHUB_REPOSITORY_NAME : $env:GITHUB_ACTION_INPUT_Name $path = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "${{ inputs.ModulesOutputPath }}\$moduleName" $moduleManifestPath = Join-Path -Path $Path -ChildPath "$moduleName.psd1" + $data = @{ + ModuleName = $moduleName + Path = $path + ModuleManifestPath = $moduleManifestPath + } + Write-Host "Data" + Write-Host ($data | Out-String) + if ($Desktop) { Add-ModuleManifestData -Path $moduleManifestPath -CompatiblePSEditions 'Desktop' Add-ModuleManifestData -Path $moduleManifestPath -Tags 'PSEdition_Desktop' From f98f0e011b2e94d8c7690ee03e0b72f4695c8464 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 01:56:43 +0100 Subject: [PATCH 07/29] fix --- .github/workflows/workflow.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 67f18bfe..f4affc64 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -310,7 +310,7 @@ jobs: exit 1 } - $moduleName = [string]::IsNullOrEmpty('${{ inputs.Name }}') ? $env:GITHUB_REPOSITORY_NAME : $env:GITHUB_ACTION_INPUT_Name + $moduleName = [string]::IsNullOrEmpty('${{ inputs.Name }}') ? $env:GITHUB_REPOSITORY_NAME : '${{ inputs.Name }}' $path = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "${{ inputs.ModulesOutputPath }}\$moduleName" $moduleManifestPath = Join-Path -Path $Path -ChildPath "$moduleName.psd1" @@ -344,6 +344,8 @@ jobs: Add-ModuleManifestData -Path $moduleManifestPath -Tags 'Windows' } + Show-FileContent -Path $moduleManifestPath + - name: Upload module artifact uses: actions/upload-artifact@v4 with: From 0322a91b1becd601775fc45df661016d4217faf5 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 02:05:51 +0100 Subject: [PATCH 08/29] test --- .github/workflows/workflow.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f4affc64..63a31db5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -330,6 +330,9 @@ jobs: if ($Core) { Add-ModuleManifestData -Path $moduleManifestPath -CompatiblePSEditions 'Core' Add-ModuleManifestData -Path $moduleManifestPath -Tags 'PSEdition_Core' + Set-ModuleManifest -Path $moduleManifestPath -PowerShellVersion '7.0' + } else { + Set-ModuleManifest -Path $moduleManifestPath -PowerShellVersion '5.1' } if ($Linux) { From 693cf705e052ed2728fc18e6faa7eebcd4780e60 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 11:41:13 +0100 Subject: [PATCH 09/29] test --- .github/workflows/workflow.yml | 26 ++++++++++++++++---------- tests/tests/PSModuleTest.Tests.ps1 | 11 ++++++++++- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 63a31db5..5367d7c7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -79,7 +79,7 @@ jobs: - name: Test built module uses: PSModule/Test-PSModule@v1 - if: ${{ inputs.SkipTests != true }} + # if: ${{ inputs.SkipTests != true }} with: Name: ${{ inputs.Name }} Path: ${{ inputs.Path }} @@ -151,8 +151,8 @@ jobs: - name: Test built module id: test uses: PSModule/Test-PSModule@tests - if: ${{ inputs.SkipTests != true }} - continue-on-error: true + # if: ${{ inputs.SkipTests != true }} + # continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} @@ -185,8 +185,8 @@ jobs: - name: Test built module id: test uses: PSModule/Test-PSModule@tests - if: ${{ inputs.SkipTests != true }} - continue-on-error: true + # if: ${{ inputs.SkipTests != true }} + # continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} @@ -219,8 +219,8 @@ jobs: - name: Test built module id: test uses: PSModule/Test-PSModule@tests - if: ${{ inputs.SkipTests != true }} - continue-on-error: true + # if: ${{ inputs.SkipTests != true }} + # continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} @@ -253,8 +253,8 @@ jobs: - name: Test built module id: test uses: PSModule/Test-PSModule@tests - if: ${{ inputs.SkipTests != true }} - continue-on-error: true + # if: ${{ inputs.SkipTests != true }} + # continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} @@ -269,6 +269,7 @@ jobs: - TestModule-pwsh-windows-latest - TestModule-powershell-windows-latest runs-on: ubuntu-latest + if: always() steps: - name: Checkout Code uses: actions/checkout@v4 @@ -288,6 +289,7 @@ jobs: - name: Summerize tests shell: pwsh run: | + Start-LogGroup -Name 'Status' $Linux = '${{ needs.TestModule-pwsh-ubuntu-latest.outputs.passed }}' -eq 'true' $MacOS = '${{ needs.TestModule-pwsh-macos-latest.outputs.passed }}' -eq 'true' $Windows = '${{ needs.TestModule-pwsh-windows-latest.outputs.passed }}' -eq 'true' @@ -309,7 +311,9 @@ jobs: Write-Host "::[error]::No tests passed" exit 1 } + Stop-LogGroup + Start-LogGroup -Name 'Data' $moduleName = [string]::IsNullOrEmpty('${{ inputs.Name }}') ? $env:GITHUB_REPOSITORY_NAME : '${{ inputs.Name }}' $path = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "${{ inputs.ModulesOutputPath }}\$moduleName" $moduleManifestPath = Join-Path -Path $Path -ChildPath "$moduleName.psd1" @@ -319,7 +323,6 @@ jobs: Path = $path ModuleManifestPath = $moduleManifestPath } - Write-Host "Data" Write-Host ($data | Out-String) if ($Desktop) { @@ -346,8 +349,11 @@ jobs: if ($Windows) { Add-ModuleManifestData -Path $moduleManifestPath -Tags 'Windows' } + Stop-LogGroup + Start-LogGroup -Name 'Module Manifest' Show-FileContent -Path $moduleManifestPath + Stop-LogGroup - name: Upload module artifact uses: actions/upload-artifact@v4 diff --git a/tests/tests/PSModuleTest.Tests.ps1 b/tests/tests/PSModuleTest.Tests.ps1 index de344a17..1fb8ee0d 100644 --- a/tests/tests/PSModuleTest.Tests.ps1 +++ b/tests/tests/PSModuleTest.Tests.ps1 @@ -1,4 +1,13 @@ -Describe 'PSModuleTest.Tests.ps1' { +[CmdletBinding()] +Param( + # Path to the module to test. + [Parameter()] + [hashtable] $Path +) + +Write-Verbose "Path to the module: [$Path]" -Verbose + +Describe 'PSModuleTest.Tests.ps1' { It 'Should be able to import the module' { Import-Module -Name 'PSModuleTest' -Verbose Get-Module -Name 'PSModuleTest' | Should -Not -BeNullOrEmpty From 91072d3456e6fea87d743e29b715993ba8c561cd Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 11:55:42 +0100 Subject: [PATCH 10/29] test --- tests/tests/PSModuleTest.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests/PSModuleTest.Tests.ps1 b/tests/tests/PSModuleTest.Tests.ps1 index 1fb8ee0d..16610253 100644 --- a/tests/tests/PSModuleTest.Tests.ps1 +++ b/tests/tests/PSModuleTest.Tests.ps1 @@ -2,7 +2,7 @@ Param( # Path to the module to test. [Parameter()] - [hashtable] $Path + [string] $Path ) Write-Verbose "Path to the module: [$Path]" -Verbose From abe0a59e2457d2b6f0962c4efbe853b3a37c7231 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 12:11:37 +0100 Subject: [PATCH 11/29] fix --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 5367d7c7..2a4852cd 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -269,7 +269,7 @@ jobs: - TestModule-pwsh-windows-latest - TestModule-powershell-windows-latest runs-on: ubuntu-latest - if: always() + if: success() || failure() steps: - name: Checkout Code uses: actions/checkout@v4 From e27bb5656906307bc5987c5463b719bf1a66c46a Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 12:22:24 +0100 Subject: [PATCH 12/29] test --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 2a4852cd..ebd3f3cd 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -399,6 +399,7 @@ jobs: PublishModule: name: Publish module + if: success() needs: - TestModule - LintDocs From d8a1ba43ac91118573c3c15f2c6445ac8291f67e Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 12:41:16 +0100 Subject: [PATCH 13/29] test --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ebd3f3cd..30b05486 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -399,7 +399,7 @@ jobs: PublishModule: name: Publish module - if: success() + if: ${{ jobs.TestModule.result == 'success' && jobs.LintDocs.result == 'success' }} needs: - TestModule - LintDocs From 2615355b7d6f295ceef773df7c1f2fa818ec1943 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 12:44:40 +0100 Subject: [PATCH 14/29] test --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 30b05486..738759c6 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -399,7 +399,7 @@ jobs: PublishModule: name: Publish module - if: ${{ jobs.TestModule.result == 'success' && jobs.LintDocs.result == 'success' }} + if: ${{ needs.TestModule.result == 'success' && needs.LintDocs.result == 'success' }} needs: - TestModule - LintDocs From 4139c2a53a1a1bc729f758af68d01d69be987777 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 13:05:27 +0100 Subject: [PATCH 15/29] test --- .github/workflows/workflow.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 738759c6..4f427cf8 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -261,7 +261,7 @@ jobs: Shell: powershell TestType: 'Module' - TestModule: + TestModuleStatus: name: Test module needs: - TestModule-pwsh-ubuntu-latest @@ -289,6 +289,10 @@ jobs: - name: Summerize tests shell: pwsh run: | + $test = '${{ toJson(needs) }}' | ConvertFrom-Json + + $test + Start-LogGroup -Name 'Status' $Linux = '${{ needs.TestModule-pwsh-ubuntu-latest.outputs.passed }}' -eq 'true' $MacOS = '${{ needs.TestModule-pwsh-macos-latest.outputs.passed }}' -eq 'true' @@ -399,9 +403,9 @@ jobs: PublishModule: name: Publish module - if: ${{ needs.TestModule.result == 'success' && needs.LintDocs.result == 'success' }} + if: ${{ needs.TestModuleStatus.result == 'success' && needs.LintDocs.result == 'success' }} needs: - - TestModule + - TestModuleStatus - LintDocs runs-on: ubuntu-latest steps: From bc7bb2a13cd917a8a2312aae8739fdc9e92693a6 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 13:31:04 +0100 Subject: [PATCH 16/29] test --- .github/workflows/workflow.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4f427cf8..4b5435de 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -291,7 +291,7 @@ jobs: run: | $test = '${{ toJson(needs) }}' | ConvertFrom-Json - $test + Write-Host ($test | Out-String) Start-LogGroup -Name 'Status' $Linux = '${{ needs.TestModule-pwsh-ubuntu-latest.outputs.passed }}' -eq 'true' @@ -401,6 +401,20 @@ jobs: RUN_LOCAL: true # Running "locally" to avoid issues with GITHUB_SHA issue of a squash merge. ENABLE_GITHUB_ACTIONS_GROUP_TITLE: true + Test: + name: Test + needs: + - TestModuleStatus + - LintDocs + runs-on: ubuntu-latest + steps: + - name: test + shell: pwsh + run: | + Write-Host "TestModuleStatus: ${{ needs.TestModuleStatus.result == 'success' }}" + Write-Host "LintDocs: ${{ needs.LintDocs.result == 'success' }}" + Write-Host "Total: ${{ needs.TestModuleStatus.result == 'success' && needs.LintDocs.result == 'success' }}" + PublishModule: name: Publish module if: ${{ needs.TestModuleStatus.result == 'success' && needs.LintDocs.result == 'success' }} From 638f9440b8ca44d32f7a81e1f01b19e263ae7204 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 13:44:07 +0100 Subject: [PATCH 17/29] test --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4b5435de..b194a3f0 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -403,6 +403,7 @@ jobs: Test: name: Test + if: success() || failure() needs: - TestModuleStatus - LintDocs From 53b7947b8e41a22ba14e835a9c5c8c2932a70d72 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 13:59:23 +0100 Subject: [PATCH 18/29] test --- .github/workflows/workflow.yml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index b194a3f0..fdb5f8b6 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -269,7 +269,7 @@ jobs: - TestModule-pwsh-windows-latest - TestModule-powershell-windows-latest runs-on: ubuntu-latest - if: success() || failure() + if: !cancelled() steps: - name: Checkout Code uses: actions/checkout@v4 @@ -401,24 +401,9 @@ jobs: RUN_LOCAL: true # Running "locally" to avoid issues with GITHUB_SHA issue of a squash merge. ENABLE_GITHUB_ACTIONS_GROUP_TITLE: true - Test: - name: Test - if: success() || failure() - needs: - - TestModuleStatus - - LintDocs - runs-on: ubuntu-latest - steps: - - name: test - shell: pwsh - run: | - Write-Host "TestModuleStatus: ${{ needs.TestModuleStatus.result == 'success' }}" - Write-Host "LintDocs: ${{ needs.LintDocs.result == 'success' }}" - Write-Host "Total: ${{ needs.TestModuleStatus.result == 'success' && needs.LintDocs.result == 'success' }}" - PublishModule: name: Publish module - if: ${{ needs.TestModuleStatus.result == 'success' && needs.LintDocs.result == 'success' }} + if: ${{ needs.TestModuleStatus.result == 'success' && needs.LintDocs.result == 'success' && !cancelled() }} needs: - TestModuleStatus - LintDocs From a749302c4ee2dd64e81e5e839a444e2406ad9a14 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 14:10:15 +0100 Subject: [PATCH 19/29] test --- .github/workflows/workflow.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index fdb5f8b6..9d5cb481 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -269,7 +269,7 @@ jobs: - TestModule-pwsh-windows-latest - TestModule-powershell-windows-latest runs-on: ubuntu-latest - if: !cancelled() + if: success() || failure() steps: - name: Checkout Code uses: actions/checkout@v4 @@ -289,10 +289,6 @@ jobs: - name: Summerize tests shell: pwsh run: | - $test = '${{ toJson(needs) }}' | ConvertFrom-Json - - Write-Host ($test | Out-String) - Start-LogGroup -Name 'Status' $Linux = '${{ needs.TestModule-pwsh-ubuntu-latest.outputs.passed }}' -eq 'true' $MacOS = '${{ needs.TestModule-pwsh-macos-latest.outputs.passed }}' -eq 'true' @@ -300,7 +296,7 @@ jobs: $Desktop = '${{ needs.TestModule-powershell-windows-latest.outputs.passed }}' -eq 'true' $Core = $Linux -or $MacOS -or $Windows - $Status = @{ + $Status = [pscustomobject]@{ Linux = $Linux MacOS = $MacOS Windows = $Windows @@ -308,8 +304,7 @@ jobs: Core = $Core } - Write-Host "Status" - Write-Host ($Status | Out-String) + Write-Host ($Status | Format-Table | Out-String) if (-not ($Core -or $Desktop)) { Write-Host "::[error]::No tests passed" @@ -322,12 +317,12 @@ jobs: $path = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "${{ inputs.ModulesOutputPath }}\$moduleName" $moduleManifestPath = Join-Path -Path $Path -ChildPath "$moduleName.psd1" - $data = @{ + $data = [pscustomobject]@{ ModuleName = $moduleName Path = $path ModuleManifestPath = $moduleManifestPath } - Write-Host ($data | Out-String) + Write-Host ($data | Format-Table | Out-String) if ($Desktop) { Add-ModuleManifestData -Path $moduleManifestPath -CompatiblePSEditions 'Desktop' @@ -403,7 +398,7 @@ jobs: PublishModule: name: Publish module - if: ${{ needs.TestModuleStatus.result == 'success' && needs.LintDocs.result == 'success' && !cancelled() }} + if: ${{ needs.TestModuleStatus.result == 'success' && needs.LintDocs.result == 'success' && (success() || failure()) }} needs: - TestModuleStatus - LintDocs From de4e8e571fd9204b749b47499995af97214b0f25 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 14:27:11 +0100 Subject: [PATCH 20/29] fix --- .github/workflows/workflow.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9d5cb481..d68de8d4 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -151,8 +151,8 @@ jobs: - name: Test built module id: test uses: PSModule/Test-PSModule@tests - # if: ${{ inputs.SkipTests != true }} - # continue-on-error: true + if: ${{ inputs.SkipTests != true }} + continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} @@ -185,8 +185,8 @@ jobs: - name: Test built module id: test uses: PSModule/Test-PSModule@tests - # if: ${{ inputs.SkipTests != true }} - # continue-on-error: true + if: ${{ inputs.SkipTests != true }} + continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} @@ -219,8 +219,8 @@ jobs: - name: Test built module id: test uses: PSModule/Test-PSModule@tests - # if: ${{ inputs.SkipTests != true }} - # continue-on-error: true + if: ${{ inputs.SkipTests != true }} + continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} @@ -253,8 +253,8 @@ jobs: - name: Test built module id: test uses: PSModule/Test-PSModule@tests - # if: ${{ inputs.SkipTests != true }} - # continue-on-error: true + if: ${{ inputs.SkipTests != true }} + continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} @@ -262,7 +262,7 @@ jobs: TestType: 'Module' TestModuleStatus: - name: Test module + name: Test module status needs: - TestModule-pwsh-ubuntu-latest - TestModule-pwsh-macos-latest From c3b49977edc83b64c4353dcb544ead2603a88b11 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 14:39:35 +0100 Subject: [PATCH 21/29] test --- .github/workflows/workflow.yml | 36 ++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index d68de8d4..3b4c64cd 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -151,14 +151,19 @@ jobs: - name: Test built module id: test uses: PSModule/Test-PSModule@tests - if: ${{ inputs.SkipTests != true }} - continue-on-error: true + # if: ${{ inputs.SkipTests != true }} + # continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} Shell: pwsh TestType: Module + - name: Set status + if: job.steps.test.status == failure() + shell: pwsh + run: Write-Host "Complete successfully" + TestModule-pwsh-macos-latest: name: Test module (pwsh, macos-latest) needs: BuildModule @@ -185,14 +190,19 @@ jobs: - name: Test built module id: test uses: PSModule/Test-PSModule@tests - if: ${{ inputs.SkipTests != true }} - continue-on-error: true + # if: ${{ inputs.SkipTests != true }} + # continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} Shell: pwsh TestType: 'Module' + - name: Set status + if: job.steps.test.status == failure() + shell: pwsh + run: Write-Host "Complete successfully" + TestModule-pwsh-windows-latest: name: Test module (pwsh, windows-latest) needs: BuildModule @@ -219,14 +229,19 @@ jobs: - name: Test built module id: test uses: PSModule/Test-PSModule@tests - if: ${{ inputs.SkipTests != true }} - continue-on-error: true + # if: ${{ inputs.SkipTests != true }} + # continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} Shell: pwsh TestType: 'Module' + - name: Set status + if: job.steps.test.status == failure() + shell: pwsh + run: Write-Host "Complete successfully" + TestModule-powershell-windows-latest: name: Test module (powershell, windows-latest) needs: BuildModule @@ -253,14 +268,19 @@ jobs: - name: Test built module id: test uses: PSModule/Test-PSModule@tests - if: ${{ inputs.SkipTests != true }} - continue-on-error: true + # if: ${{ inputs.SkipTests != true }} + # continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} Shell: powershell TestType: 'Module' + - name: Set status + if: job.steps.test.status == failure() + shell: pwsh + run: Write-Host "Complete successfully" + TestModuleStatus: name: Test module status needs: From 93d0d5b3c4901c7544359dec9737496eec5ba774 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 14:48:45 +0100 Subject: [PATCH 22/29] test --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 3b4c64cd..2e1cfee4 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -160,7 +160,7 @@ jobs: TestType: Module - name: Set status - if: job.steps.test.status == failure() + if: steps.test.conclusion != 'success' shell: pwsh run: Write-Host "Complete successfully" From 0d46bb69c183e4c3e13b7122a709f88d82ecf4d5 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 14:48:58 +0100 Subject: [PATCH 23/29] fix --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 2e1cfee4..2bc689a4 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -160,7 +160,7 @@ jobs: TestType: Module - name: Set status - if: steps.test.conclusion != 'success' + if: steps.test.conclusion != 'success' shell: pwsh run: Write-Host "Complete successfully" From 464761a8892aa5bb35f5e0a388256c00fb2b6f2e Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 14:56:29 +0100 Subject: [PATCH 24/29] fix --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 2bc689a4..e4879483 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -160,7 +160,7 @@ jobs: TestType: Module - name: Set status - if: steps.test.conclusion != 'success' + if: steps.test.outcome != 'success' shell: pwsh run: Write-Host "Complete successfully" From d916e157de91068504c7aeb99eb0925b4df6c459 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 15:05:49 +0100 Subject: [PATCH 25/29] test --- .github/workflows/workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e4879483..068b84c6 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -199,7 +199,7 @@ jobs: TestType: 'Module' - name: Set status - if: job.steps.test.status == failure() + if: steps.test.outcome != 'success' shell: pwsh run: Write-Host "Complete successfully" @@ -238,7 +238,7 @@ jobs: TestType: 'Module' - name: Set status - if: job.steps.test.status == failure() + if: steps.test.outcome != 'success' shell: pwsh run: Write-Host "Complete successfully" @@ -277,7 +277,7 @@ jobs: TestType: 'Module' - name: Set status - if: job.steps.test.status == failure() + if: steps.test.outcome != 'success' shell: pwsh run: Write-Host "Complete successfully" From da4b0a0ed34cb6b0e59add03e816f82a68ba3ec2 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 15:19:19 +0100 Subject: [PATCH 26/29] test --- .github/workflows/workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 068b84c6..48a488a8 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -152,7 +152,7 @@ jobs: id: test uses: PSModule/Test-PSModule@tests # if: ${{ inputs.SkipTests != true }} - # continue-on-error: true + continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} @@ -191,7 +191,7 @@ jobs: id: test uses: PSModule/Test-PSModule@tests # if: ${{ inputs.SkipTests != true }} - # continue-on-error: true + continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} @@ -230,7 +230,7 @@ jobs: id: test uses: PSModule/Test-PSModule@tests # if: ${{ inputs.SkipTests != true }} - # continue-on-error: true + continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} @@ -269,7 +269,7 @@ jobs: id: test uses: PSModule/Test-PSModule@tests # if: ${{ inputs.SkipTests != true }} - # continue-on-error: true + continue-on-error: true with: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} From 410bda48b5496cd5ddd29ebbb6a4c2e73a69498d Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 15:52:59 +0100 Subject: [PATCH 27/29] Use v1 again --- .github/workflows/workflow.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 48a488a8..0390db5f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -79,7 +79,7 @@ jobs: - name: Test built module uses: PSModule/Test-PSModule@v1 - # if: ${{ inputs.SkipTests != true }} + if: ${{ inputs.SkipTests != true }} with: Name: ${{ inputs.Name }} Path: ${{ inputs.Path }} @@ -150,8 +150,8 @@ jobs: - name: Test built module id: test - uses: PSModule/Test-PSModule@tests - # if: ${{ inputs.SkipTests != true }} + uses: PSModule/Test-PSModule@v1 + if: ${{ inputs.SkipTests != true }} continue-on-error: true with: Name: ${{ inputs.Name }} @@ -189,8 +189,8 @@ jobs: - name: Test built module id: test - uses: PSModule/Test-PSModule@tests - # if: ${{ inputs.SkipTests != true }} + uses: PSModule/Test-PSModule@v1 + if: ${{ inputs.SkipTests != true }} continue-on-error: true with: Name: ${{ inputs.Name }} @@ -228,8 +228,8 @@ jobs: - name: Test built module id: test - uses: PSModule/Test-PSModule@tests - # if: ${{ inputs.SkipTests != true }} + uses: PSModule/Test-PSModule@v1 + if: ${{ inputs.SkipTests != true }} continue-on-error: true with: Name: ${{ inputs.Name }} @@ -267,8 +267,8 @@ jobs: - name: Test built module id: test - uses: PSModule/Test-PSModule@tests - # if: ${{ inputs.SkipTests != true }} + uses: PSModule/Test-PSModule@v1 + if: ${{ inputs.SkipTests != true }} continue-on-error: true with: Name: ${{ inputs.Name }} From cd57ff8b07426bfb1c281c090cef58d226850af8 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 15:55:18 +0100 Subject: [PATCH 28/29] remove test file --- .github/workflows/testmodule.yml | 47 -------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 .github/workflows/testmodule.yml diff --git a/.github/workflows/testmodule.yml b/.github/workflows/testmodule.yml deleted file mode 100644 index 3be0db18..00000000 --- a/.github/workflows/testmodule.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Test-Module - -on: - workflow_call: - inputs: - OS: - type: string - description: The operating system to use for the build and test jobs. - required: true - Shell: - type: string - description: The shell to use for the build and test jobs. - required: true - -jobs: - TestModule: - name: Test module (${{ inputs.Shell }}@${{ inputs.OS }}) - runs-on: ${{ inputs.OS }} - outputs: - passed: ${{ steps.test.outputs.passed }} - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Initialize environment - uses: PSModule/Initialize-PSModule@v1 - with: - Version: ${{ inputs.Version }} - Prerelease: ${{ inputs.Prerelease }} - Shell: ${{ inputs.Shell }} - - - name: Download module artifact - uses: actions/download-artifact@v4 - with: - name: module - path: ${{ inputs.ModulesOutputPath }} - - - name: Test built module - id: test - uses: PSModule/Test-PSModule@v1 - if: ${{ inputs.SkipTests != true }} - continue-on-error: true - with: - Name: ${{ inputs.Name }} - Path: ${{ inputs.ModulesOutputPath }} - Shell: ${{ inputs.Shell }} - TestType: Module From 58add84720a711ba4f573d315a75730d38d1234e Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 28 Mar 2024 15:57:08 +0100 Subject: [PATCH 29/29] remove unnecessary quotes --- .github/workflows/workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0390db5f..94f79ba5 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -196,7 +196,7 @@ jobs: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} Shell: pwsh - TestType: 'Module' + TestType: Module - name: Set status if: steps.test.outcome != 'success' @@ -235,7 +235,7 @@ jobs: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} Shell: pwsh - TestType: 'Module' + TestType: Module - name: Set status if: steps.test.outcome != 'success' @@ -274,7 +274,7 @@ jobs: Name: ${{ inputs.Name }} Path: ${{ inputs.ModulesOutputPath }} Shell: powershell - TestType: 'Module' + TestType: Module - name: Set status if: steps.test.outcome != 'success'