Skip to content

Commit 88eadb7

Browse files
authored
Merge pull request #434 from PowerShellOrg/FixBuild
2 parents cacbd76 + d44479a commit 88eadb7

24 files changed

Lines changed: 647 additions & 1739 deletions
Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
# spell-checker:ignore potatoqualitee psdepend psmodulecache
12
name: PesterReports
23
# Controls when the action will run.
34
on:
45
# Triggers the workflow on push or pull request events but only for the master branch
56
push:
67
branches: [ master ]
78
pull_request:
8-
branches: [ master ]
9-
109
# Allows you to run this workflow manually from the Actions tab
1110
workflow_dispatch:
11+
permissions:
12+
checks: write
13+
pull-requests: write
1214

1315
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1416
jobs:
@@ -21,40 +23,49 @@ jobs:
2123
os: [ubuntu-latest, windows-latest, macOS-latest]
2224
# Steps represent a sequence of tasks that will be executed as part of the job
2325
steps:
24-
- uses: actions/checkout@v2
25-
# Setup Build Helpers
26-
- name: SetupBuildHelpers
26+
- uses: actions/checkout@v4
27+
- name: Install and cache PSDepend
28+
id: psdepend
29+
uses: potatoqualitee/psmodulecache@v6.2.1
30+
with:
31+
modules-to-cache: PSDepend:0.3.8
32+
- name: Determine modules to cache
2733
shell: pwsh
34+
id: modules-to-cache
2835
run: |
29-
Install-Module BuildHelpers -Scope CurrentUser -Force | Out-Null
30-
Install-Module PowerShellBuild -Scope CurrentUser -Force | Out-Null
31-
Install-Module PSScriptAnalyzer -Scope CurrentUser -Force | Out-Null
32-
Install-Module platyPS -Scope CurrentUser -Force | Out-Null
36+
$dependencies = Get-Dependency
37+
$f = $dependencies | ?{ $_.DependencyType -eq 'PSGalleryModule' } | %{ "{0}:{1}" -F $_.DependencyName, $_.Version}
38+
Write-Output "::set-output name=ModulesToCache::$($f -join ', ')"
39+
- name: Install and cache PowerShell modules
40+
id: psmodulecache
41+
uses: potatoqualitee/psmodulecache@v6.2.1
42+
with:
43+
modules-to-cache: ${{ steps.modules-to-cache.outputs.ModulesToCache }}
44+
shell: pwsh
3345
- name: Test
3446
shell: pwsh
35-
run: |
36-
./build.ps1 -Task Test
47+
run: ./build.ps1 -Task Test
3748
- name: Upload Unit Test Results
3849
if: always()
39-
uses: actions/upload-artifact@v2
50+
uses: actions/upload-artifact@v4.6.2
4051
with:
4152
name: Unit Test Results (OS ${{ matrix.os }})
42-
path: ./tests/Out/testResults.xml
53+
path: ./tests/out/testResults.xml
4354

4455
publish-test-results:
4556
name: "Publish Unit Tests Results"
4657
needs: test
4758
runs-on: ubuntu-latest
4859
# the test job might be skipped, we don't need to run this job then
49-
if: success() || failure()
60+
if: (!cancelled())
5061

5162
steps:
5263
- name: Download Artifacts
53-
uses: actions/download-artifact@v2
64+
uses: actions/download-artifact@v4.3.0
5465
with:
5566
path: artifacts
5667

5768
- name: Publish Unit Test Results
58-
uses: EnricoMi/publish-unit-test-result-action@v1
69+
uses: EnricoMi/publish-unit-test-result-action@v2.20.0
5970
with:
6071
files: artifacts/**/*.xml

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
// When enabled, will trim trailing whitespace when you save a file.
44
"files.trimTrailingWhitespace": true,
55
"search.exclude": {
6-
"Release": true
6+
"Release": true,
7+
"Output": true,
78
},
9+
"editor.tabSize": 4,
810
//-------- PowerShell Configuration --------
911
// Use a custom PowerShell Script Analyzer settings file for this workspace.
1012
// Relative paths for this setting are always relative to the workspace root dir.

.vscode/tasks.json

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,60 @@
22
// See https://go.microsoft.com/fwlink/?LinkId=733558
33
// for the documentation about the tasks.json format
44
"version": "2.0.0",
5-
65
// Start PowerShell
76
"windows": {
87
"options": {
98
"shell": {
10-
"executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
11-
"args": [ "-NoProfile", "-ExecutionPolicy", "Bypass", "-Command" ]
9+
"executable": "pwsh.exe",
10+
"args": [
11+
"-NoProfile",
12+
"-ExecutionPolicy",
13+
"Bypass",
14+
"-Command"
15+
]
1216
}
1317
}
1418
},
1519
"linux": {
1620
"options": {
1721
"shell": {
1822
"executable": "/usr/bin/pwsh",
19-
"args": [ "-NoProfile", "-Command" ]
23+
"args": [
24+
"-NoProfile",
25+
"-Command"
26+
]
2027
}
2128
}
2229
},
2330
"osx": {
2431
"options": {
2532
"shell": {
2633
"executable": "/usr/local/bin/pwsh",
27-
"args": [ "-NoProfile", "-Command" ]
34+
"args": [
35+
"-NoProfile",
36+
"-Command"
37+
]
2838
}
2939
}
3040
},
31-
3241
// Associate with test task runner
3342
"tasks": [
43+
{
44+
"label": "Bootstrap",
45+
"type": "shell",
46+
"command": "./build.ps1 -Task Init -Bootstrap",
47+
"problemMatcher": []
48+
},
3449
{
3550
"label": "Clean",
3651
"type": "shell",
37-
"command": "Invoke-psake build.psake.ps1 -taskList Clean",
52+
"command": "./build.ps1 -Task Clean",
3853
"problemMatcher": []
3954
},
4055
{
4156
"label": "Build",
4257
"type": "shell",
43-
"command": "Invoke-psake build.psake.ps1 -taskList Build",
58+
"command": "./build.ps1 -Task Build",
4459
"group": {
4560
"kind": "build",
4661
"isDefault": true
@@ -50,36 +65,38 @@
5065
{
5166
"label": "BuildHelp",
5267
"type": "shell",
53-
"command": "Invoke-psake build.psake.ps1 -taskList BuildHelp",
68+
"command": "./build.ps1 -Task BuildHelp",
5469
"problemMatcher": []
5570
},
5671
{
5772
"label": "Analyze",
5873
"type": "shell",
59-
"command": "Invoke-psake build.psake.ps1 -taskList Analyze",
74+
"command": "./build.ps1 -Task Analyze",
6075
"problemMatcher": []
6176
},
6277
{
6378
"label": "Install",
6479
"type": "shell",
65-
"command": "Invoke-psake build.psake.ps1 -taskList Install",
80+
"command": "./build.ps1 -Task Install",
6681
"problemMatcher": []
6782
},
6883
{
6984
"label": "Publish",
7085
"type": "shell",
71-
"command": "Invoke-psake build.psake.ps1 -taskList Publish",
86+
"command": "./build.ps1 -Task Publish",
7287
"problemMatcher": []
7388
},
7489
{
7590
"label": "Test",
7691
"type": "shell",
77-
"command": "Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true}",
92+
"command": "./build.ps1 -Task Test",
7893
"group": {
7994
"kind": "test",
8095
"isDefault": true
8196
},
82-
"problemMatcher": [ "$pester" ]
97+
"problemMatcher": [
98+
"$pester"
99+
]
83100
}
84-
]
85-
}
101+
]
102+
}

Plaster/Plaster.psd1

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
@{
22
# Script module or binary module file associated with this manifest.
3-
RootModule = 'Plaster.psm1'
3+
RootModule = 'Plaster.psm1'
44

55
# ID used to uniquely identify this module
6-
GUID = 'cfce3c5e-402f-412a-a83a-7b7ee9832ff4'
6+
GUID = 'cfce3c5e-402f-412a-a83a-7b7ee9832ff4'
77

88
# Version number of this module.
9-
ModuleVersion = '2.0.0'
9+
ModuleVersion = '2.0.0'
1010

1111
# Supported PSEditions
1212
CompatiblePSEditions = @('Desktop', 'Core')
1313

1414
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a
1515
# PSData hashtable with additional module metadata used by PowerShell.
16-
PrivateData = @{
16+
PrivateData = @{
1717
PSData = @{
1818
# Tags applied to this module. These help with module discovery in online galleries.
19-
Tags = @('Plaster', 'CodeGenerator', 'Scaffold', 'Template', 'JSON', 'PowerShell7')
19+
Tags = @('Plaster', 'CodeGenerator', 'Scaffold', 'Template', 'JSON', 'PowerShell7')
2020

2121
# A URL to the license for this module.
2222
LicenseUri = 'https://github.com/PowerShellOrg/Plaster/blob/master/LICENSE'
@@ -61,16 +61,16 @@ For the complete changelog, see: https://github.com/PowerShellOrg/Plaster/blob/m
6161
}
6262

6363
# Author of this module
64-
Author = 'PowerShell.org'
64+
Author = 'PowerShell.org'
6565

6666
# Company or vendor of this module
67-
CompanyName = 'PowerShell.org'
67+
CompanyName = 'PowerShell.org'
6868

6969
# Copyright statement for this module
70-
Copyright = '(c) PowerShell.org 2016-2025. All rights reserved.'
70+
Copyright = '(c) PowerShell.org 2016-2025. All rights reserved.'
7171

7272
# Description of the functionality provided by this module
73-
Description = 'Plaster is a template-based file and project generator written in PowerShell. Create consistent PowerShell projects with customizable templates supporting both XML and JSON formats.'
73+
Description = 'Plaster is a template-based file and project generator written in PowerShell. Create consistent PowerShell projects with customizable templates supporting both XML and JSON formats.'
7474

7575
# Minimum version of the Windows PowerShell engine required by this module
7676
PowerShellVersion = '5.1'
@@ -99,21 +99,16 @@ For the complete changelog, see: https://github.com/PowerShellOrg/Plaster/blob/m
9999
# Functions to export from this module - explicitly list each function that should be
100100
# exported. This improves performance of PowerShell when discovering the commands in
101101
# module.
102-
FunctionsToExport = @(
103-
'Invoke-Plaster'
104-
'New-PlasterManifest'
105-
'Get-PlasterTemplate'
106-
'Test-PlasterManifest'
107-
)
102+
FunctionsToExport = '*'
108103

109104
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
110-
CmdletsToExport = @()
105+
CmdletsToExport = '*'
111106

112107
# Variables to export from this module
113-
# VariablesToExport = @()
108+
VariablesToExport = @()
114109

115110
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
116-
AliasesToExport = @()
111+
AliasesToExport = @()
117112

118113
# DSC resources to export from this module
119114
# DscResourcesToExport = @()

0 commit comments

Comments
 (0)