Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit test generation #118

Merged
merged 4 commits into from
Nov 16, 2024
Merged
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
28 changes: 14 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
name: Prerequisites
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache Powershell Modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: 20210527|${{ hashFiles('**/vsts-prerequisites.ps1') }}
Expand All @@ -30,10 +30,10 @@ jobs:
runs-on: windows-latest
needs: prerequisites
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache Powershell Modules
id: cache-powershell-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: 20210527|${{ hashFiles('**/vsts-prerequisites.ps1') }}
Expand All @@ -46,7 +46,7 @@ jobs:
run: build\vsts-validate.ps1 -TestGeneral $true -TestFunctions $false -Exclude "PSScriptAnalyzer.Tests.ps1"
- name: Publish Test Results **/TEST-*.xml
if: always()
uses: EnricoMi/publish-unit-test-result-action/composite@v2
uses: EnricoMi/publish-unit-test-result-action/windows@v2
with:
files: '**/TEST-*.xml'
check_name: 'General Unit Tests Results'
Expand All @@ -57,10 +57,10 @@ jobs:
runs-on: windows-latest
needs: prerequisites
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache Powershell Modules
id: cache-powershell-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: 20210527|${{ hashFiles('**/vsts-prerequisites.ps1') }}
Expand All @@ -73,7 +73,7 @@ jobs:
run: build\vsts-validate-psscriptanalyzer.ps1 -TestPublic $true -TestInternal $false
- name: Publish Test Results **/TEST-*.xml
if: always()
uses: EnricoMi/publish-unit-test-result-action/composite@v2
uses: EnricoMi/publish-unit-test-result-action/windows@v2
with:
files: '**/TEST-*.xml'
check_name: 'Public Functions Unit Tests Results'
Expand All @@ -84,10 +84,10 @@ jobs:
runs-on: windows-latest
needs: Prerequisites
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache Powershell Modules
id: cache-powershell-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: 20210527|${{ hashFiles('**/vsts-prerequisites.ps1') }}
Expand All @@ -100,7 +100,7 @@ jobs:
run: build\vsts-validate-psscriptanalyzer.ps1 -TestPublic $false -TestInternal $true
- name: Publish Test Results **/TEST-*.xml
if: always()
uses: EnricoMi/publish-unit-test-result-action/composite@v2
uses: EnricoMi/publish-unit-test-result-action/windows@v2
with:
files: '**/TEST-*.xml'
check_name: 'Internal Functions Unit Tests Results'
Expand All @@ -111,10 +111,10 @@ jobs:
runs-on: windows-latest
needs: prerequisites
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache Powershell Modules
id: cache-powershell-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: 20210527|${{ hashFiles('**/vsts-prerequisites.ps1') }}
Expand All @@ -127,7 +127,7 @@ jobs:
run: build\vsts-validate.ps1 -TestGeneral $false -TestFunctions $true
- name: Publish Test Results **/TEST-*.xml
if: always()
uses: EnricoMi/publish-unit-test-result-action/composite@v2
uses: EnricoMi/publish-unit-test-result-action/windows@v2
with:
files: '**/TEST-*.xml'
check_name: 'Individual Unit Tests Results'
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/update-generated-text.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
name: Generate text
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache Powershell Modules
id: cache-powershell-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\Documents\WindowsPowerShell\Modules
key: 20210527|${{ hashFiles('**/vsts-prerequisites.ps1, **/buildtools.ps1') }}
key: 20210527|${{ hashFiles('**/vsts-prerequisites.ps1', '**/buildtools.ps1') }}
- name: Prerequisites
if: steps.cache-powershell-modules.outputs.cache-hit != 'true'
shell: powershell
Expand All @@ -40,11 +40,12 @@ jobs:
shell: powershell
run: build\generate-findcommandindex.ps1
- name: Create a pull request for changes
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v7
with:
commit-message: |
🤖 Fix best practice deviations

This pull request was automatically created by the d365fo.tools-Generate-Text action'
title: '🤖 Fix best practice deviations'
body: 'This pull request was automatically created by the d365fo.tools-Generate-Text action. See [Building tools](https://github.com/d365collaborative/d365fo.tools/wiki/Building-tools) for more information.'
body: 'This pull request was automatically created by the d365fo.tools-Generate-Text action. See [Building tools](https://github.com/d365collaborative/d365fo.tools/wiki/Building-tools) for more information.'
branch: 'update-generated-text/pull-request-patch-for-branch-${{ github.ref_name }}'
2 changes: 1 addition & 1 deletion .github/workflows/update-wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Publish wiki folder to repository wiki
uses: FH-Inway/github-wiki-publish-action@rsync
Expand Down
3 changes: 2 additions & 1 deletion build/buildtools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ foreach ($item in $modules) {
Write-Host "Installing $item" -ForegroundColor Cyan
Install-Module -Name $item -Force -Confirm:$false -Scope CurrentUser -AllowClobber -SkipPublisherCheck
}

Import-Module $item -Force
Get-Module -Name $item
}
4 changes: 3 additions & 1 deletion build/vsts-prerequisites.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Write-Host "The user running is: $($env:UserName)"
# $modules = @("PSFramework", "Az.Storage", "AzureAd", "PSNotification", "PSOAuthHelper", "PowerShellGet", "PackageManagement","ImportExcel","PSScriptAnalyzer")
$modules = @("PSFramework", "PSScriptAnalyzer", "Az.Storage", "AzureAd", "PSNotification", "PSOAuthHelper", "ImportExcel")

Write-Host "Installing Pester, maximum version 4.99.99" -ForegroundColor Cyan
Install-Module "Pester" -MaximumVersion 4.99.99 -Force -Confirm:$false -Scope CurrentUser -AllowClobber -SkipPublisherCheck

foreach ($item in $modules) {
Expand All @@ -14,6 +15,7 @@ foreach ($item in $modules) {
Write-Host "Installing $item" -ForegroundColor Cyan
Install-Module -Name $item -Force -Confirm:$false -Scope CurrentUser -AllowClobber -SkipPublisherCheck
}

Import-Module $item -Force
Get-Module -Name $item
}