Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Indented PowerShell module

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup (pwsh)
if: github.event.pull_request.base.ref == 'main'
shell: pwsh
run: .\build.ps1 -TaskName Setup

- name: Setup (winps)
if: github.event.pull_request.base.ref == 'main' && runner.os == 'Windows'
shell: powershell
run: .\build.ps1 -TaskName Setup

- name: Build
shell: pwsh
run: .\build.ps1 -TaskName Clean, Build

- name: Unit test (pwsh)
if: github.event.pull_request.base.ref == 'main'
shell: pwsh
run: .\build.ps1 -TaskName Test

- name: Unit test (winps)
if: github.event.pull_request.base.ref == 'main' && runner.os == 'Windows'
shell: powershell
run: .\build.ps1 -TaskName Test

- name: Publish Test Report
if: github.event.pull_request.base.ref == 'main' && always()
uses: mikepenz/action-junit-report@v2
with:
report_paths: '**/build/junit-*.xml'
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"diffEditor.ignoreTrimWhitespace": true,
"editor.trimAutoWhitespace": true,
"editor.renderFinalNewline": false,
"editor.renderFinalNewline": "off",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
Expand Down
7 changes: 7 additions & 0 deletions Indented.Net.IP/build.psd1
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
@{
ModuleManifest = 'Indented.Net.IP.psd1'
SourceDirectories = @(
'enum'
'class'
'private'
'public'
)
PublicFilter = 'public\*.ps1'
OutputDirectory = '../build'
VersionedOutputDirectory = $true
}
9 changes: 5 additions & 4 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Clean {
}

function Build {
Build-Module -Path (Resolve-Path $PSScriptRoot\*\build.psd1)
Build-Module -Path (Resolve-Path $PSScriptRoot\*\build.psd1) -Verbose

$rootModule = Join-Path -Path $PSScriptRoot -ChildPath 'build\*\*\*.psm1' | Resolve-Path
$tokens = $errors = $null
Expand Down Expand Up @@ -65,7 +65,7 @@ function Test {
}
}

Import-Module -Name $modulePath -Force -Global
$moduleInfo = Import-Module -Name $modulePath -Force -Global -PassThru

$configuration = @{
Run = @{
Expand All @@ -78,8 +78,9 @@ function Test {
OutputPath = Join-Path -Path $PSScriptRoot -ChildPath 'build\codecoverage.xml'
}
TestResult = @{
Enabled = $true
OutputPath = Join-Path -Path $PSScriptRoot -ChildPath 'build\nunit.xml'
Enabled = $true
OutputPath = Join-Path -Path $PSScriptRoot -ChildPath ('build\junit-{0}.xml' -f $moduleInfo.Name)
OutputFormat = 'JUnitXml'
}
Output = @{
Verbosity = 'Detailed'
Expand Down