Skip to content

Commit

Permalink
Merge pull request #865 from FH-Inway/fix-unit-test-generation
Browse files Browse the repository at this point in the history
Improve actions
  • Loading branch information
FH-Inway authored Nov 8, 2024
2 parents d780e23 + 8eaee90 commit b93c83a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 22 deletions.
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
}

0 comments on commit b93c83a

Please sign in to comment.