Skip to content

Commit

Permalink
Update CI files - Fixes #73 (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
PlagueHO committed Apr 14, 2020
2 parents fe92d5d + 9a10295 commit 7cdd2cf
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 31 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
# Set default behavior to automatically normalize line endings.
###############################################################################
* text eol=crlf

# Ensure any exe files are treated as binary
*.exe binary
*.jpg binary
*.xl* binary
*.pfx binary
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
*.user
*.coverage
.vs
.vscode
.psproj
.sln
markdownissues.txt
TestResults.xml
output/
15 changes: 3 additions & 12 deletions .vscode/analyzersettings.psd1
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
@{
<#
For the custom rules to work, the DscResource.Tests repo must be
cloned. It is automatically clone as soon as any unit or
integration tests are run.
#>
CustomRulePath = '.\DSCResource.Tests\DscResource.AnalyzerRules'

CustomRulePath = '.\output\RequiredModules\DscResource.AnalyzerRules'
includeDefaultRules = $true
IncludeRules = @(
# DSC Resource Kit style guideline rules.
'PSAvoidDefaultValueForMandatoryParameter',
Expand Down Expand Up @@ -43,11 +38,7 @@
'PSUseDeclaredVarsMoreThanAssignments',
'PSUsePSCredentialType',

<#
This is to test all the DSC Resource Kit custom rules.
The name of the function-blocks of each custom rule start
with 'Measure*'.
#>
'Measure-*'
)

}
29 changes: 26 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
// Place your settings in this file to overwrite default and user settings.
{
"powershell.codeFormatting.openBraceOnSameLine": false,
"powershell.codeFormatting.newLineAfterOpenBrace": false,
"powershell.codeFormatting.newLineAfterOpenBrace": true,
"powershell.codeFormatting.newLineAfterCloseBrace": true,
"powershell.codeFormatting.whitespaceBeforeOpenBrace": true,
"powershell.codeFormatting.whitespaceBeforeOpenParen": true,
"powershell.codeFormatting.whitespaceAroundOperator": true,
"powershell.codeFormatting.whitespaceAfterSeparator": true,
"powershell.codeFormatting.ignoreOneLineBlock": false,
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationAfterEveryPipeline",
"powershell.codeFormatting.preset": "Custom",
"powershell.codeFormatting.alignPropertyValuePairs": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"powershell.scriptAnalysis.settingsPath": ".vscode\\analyzersettings.psd1"
"powershell.scriptAnalysis.settingsPath": ".vscode\\analyzersettings.psd1",
"powershell.scriptAnalysis.enable": true,
"files.associations": {
"*.ps1xml": "xml"
},
"cSpell.words": [
"COMPANYNAME",
"ICONURI",
"LICENSEURI",
"PROJECTURI",
"RELEASENOTES",
"buildhelpers",
"endregion",
"gitversion",
"icontains",
"keepachangelog",
"notin",
"pscmdlet",
"steppable"
],
"[markdown]": {
"files.encoding": "utf8"
}
}
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Added build task `Generate_Conceptual_Help` to generate conceptual help
for the DSC resource.
- Added build task `Generate_Wiki_Content` to generate the wiki content
that can be used to update the GitHub Wiki.

### Changed

- Updated CI pipeline files.
- No longer run integration tests when running the build task `test`, e.g.
`.\build.ps1 -Task test`. To manually run integration tests, run the
following:
```powershell
.\build.ps1 -Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0
```

## [3.1.1] - 2020-01-31

### Changed
Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Contributing

Please check out common DSC Community [contributing guidelines](https://dsccommunity.org/guidelines/contributing).

## Running the Tests

If want to know how to run this module's tests you can look at the [Testing Guidelines](https://dsccommunity.org/guidelines/testing-guidelines/#running-tests)
7 changes: 4 additions & 3 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
@{
# Set up a mini virtual environment...
PSDependOptions = @{
AddToPath = $True
Target = 'output\RequiredModules'
Parameters = @{
Repository = ''
}
}

invokeBuild = 'latest'
InvokeBuild = 'latest'
PSScriptAnalyzer = 'latest'
pester = 'latest'
Pester = 'latest'
Plaster = 'latest'
ModuleBuilder = '1.0.0'
ChangelogManagement = 'latest'
Sampler = 'latest'
'DscResource.Test' = 'latest'
'DscResource.AnalyzerRules' = 'latest'
'DscResource.DocGenerator' = 'latest'
xDscResourceDesigner = 'latest'
}
9 changes: 4 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
trigger:
branches:
include:
- '*'
- master
paths:
include:
- source/**/*
tags:
include:
- "v*"
exclude:
- "*-*"
pr:
branches:
include:
- master

stages:
- stage: Build
Expand Down
38 changes: 33 additions & 5 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ param
[validateScript(
{ Test-Path -Path $_ }
)]
$BuildConfig = './build.yaml',
$BuildConfig,

[Parameter()]
# A Specific folder to build the artefact into.
Expand All @@ -35,22 +35,34 @@ param
[Parameter()]
$RequiredModulesDirectory = $(Join-Path 'output' 'RequiredModules'),

[Parameter()]
[object[]]
$PesterScript,

# Filter which tags to run when invoking Pester tests
# This is used in the Invoke-Pester.pester.build.ps1 tasks
[Parameter()]
[string[]]
$PesterTag,

[Parameter()]
[string[]]
$PesterScript,

# Filter which tags to exclude when invoking Pester tests
# This is used in the Invoke-Pester.pester.build.ps1 tasks
[Parameter()]
[string[]]
$PesterExcludeTag,

# Filter which tags to run when invoking DSC Resource tests
# This is used in the DscResource.Test.build.ps1 tasks
[Parameter()]
[string[]]
$DscTestTag,

# Filter which tags to exclude when invoking DSC Resource tests
# This is used in the DscResource.Test.build.ps1 tasks
[Parameter()]
[string[]]
$DscTestExcludeTag,

[Parameter()]
[Alias('bootstrap')]
[switch]$ResolveDependency,
Expand Down Expand Up @@ -210,6 +222,22 @@ process

Begin
{
# Find build config if not specified
if (-not $BuildConfig) {
$config = Get-ChildItem -Path "$PSScriptRoot\*" -Include 'build.y*ml', 'build.psd1', 'build.json*' -ErrorAction:Ignore
if (-not $config -or ($config -is [array] -and $config.Length -le 0)) {
throw "No build configuration found. Specify path via -BuildConfig"
}
elseif ($config -is [array]) {
if ($config.Length -gt 1) {
throw "More than one build configuration found. Specify which one to use via -BuildConfig"
}
$BuildConfig = $config[0]
}
else {
$BuildConfig = $config
}
}
# Bootstrapping the environment before using Invoke-Build as task runner

if ($MyInvocation.ScriptName -notLike '*Invoke-Build.ps1')
Expand Down
6 changes: 4 additions & 2 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ BuildWorkflow:
- Build_Module_ModuleBuilder
- Build_NestedModules_ModuleBuilder
- Create_changelog_release_output
- Generate_Conceptual_Help
- Generate_Wiki_Content

pack:
- build
Expand All @@ -38,7 +40,6 @@ BuildWorkflow:
- Publish_release_to_GitHub
- publish_module_to_gallery


####################################################
# PESTER Configuration #
####################################################
Expand All @@ -48,7 +49,6 @@ Pester:
ExcludeFromCodeCoverage:
Script:
- tests/Unit
- tests/Integration
ExcludeTag:
Tag:
CodeCoverageThreshold: 85
Expand All @@ -68,6 +68,8 @@ Resolve-Dependency:
ModuleBuildTasks:
Sampler:
- '*.build.Sampler.ib.tasks'
DscResource.DocGenerator:
- 'Task.*'

TaskHeader: |
param($Path)
Expand Down

0 comments on commit 7cdd2cf

Please sign in to comment.