Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Hunt committed Dec 14, 2023
1 parent eef955a commit 2eb571a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/powershell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ jobs:
publish
retention-days: 1

test:
test7:
permissions:
contents: read # for actions/checkout to fetch code
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Test
name: Test PowerShell 7
needs: Build
runs-on: ubuntu-latest
container:
Expand All @@ -86,12 +86,32 @@ jobs:
shell: pwsh
run: ./build.ps1 test

test5:
permissions:
contents: read # for actions/checkout to fetch code
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Test PowerShell 5
needs: Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Download build output
uses: actions/download-artifact@v3
with:
name: build
path: publish

- name: Test
shell: pwsh
run: ./build.ps1 test

publish:
permissions:
contents: read # for actions/checkout to fetch code
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Publish
needs: Test
needs: [test7, test5]
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/dotnet/sdk:8.0
Expand Down
4 changes: 4 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ function Clean {
function Build {
param ()

if ($null -eq (Get-Module -Name 'powershell-yaml' -ListAvailable)) {
Install-Module 'powershell-yaml' -Scope CurrentUser -Confirm:$false -Force
}

New-Item -Path $publish -ItemType Directory -ErrorAction SilentlyContinue | Out-Null

dotnet publish $csproj -o $lib
Expand Down
4 changes: 0 additions & 4 deletions test/Import-ConfigData.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
BeforeAll {

if ($null -eq (Get-Module -Name 'powershell-yaml' -ListAvailable)) {
Install-Module 'powershell-yaml' -Scope CurrentUser -Confirm:$false -Force
}

Import-Module "$PSScriptRoot/../publish/Import-ConfigData" -Force

}
Expand Down

0 comments on commit 2eb571a

Please sign in to comment.