update workflow #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: .NET | |
on: | |
push: | |
branches: [ "ci-work" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: src | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.x' | |
- name: Display dotnet version | |
run: dotnet --version | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Add Microsoft.PowerShell.SDK | |
run: dotnet add package Microsoft.PowerShell.SDK --version 7.3.8 | |
- name: Add PowerShellStandard.Library | |
run: dotnet add package PowerShellStandard.Library --version 7.0.0-preview.1 | |
- name: Add Newtonsoft.Json | |
run: dotnet add package Newtonsoft.Json --version 13.0.3 | |
- name: Display the path | |
shell: pwsh | |
run: echo ${env:PATH} | |
- name: Version Display | |
shell: pwsh | |
run: $PSVersionTable | |
# uncomment below to explore what modules/variables/env variables are available in the build image | |
# - name: Modules and Variables Display | |
# shell: pwsh | |
# run: Get-Module -ListAvailable; (Get-Variable).GetEnumerator() | Sort-Object Name | Out-String; (Get-ChildItem env:*).GetEnumerator() | Sort-Object Name | Out-String | |
- name: Bootstrap | |
shell: pwsh | |
run: ./actions_bootstrap.ps1 | |
- name: Test and Build | |
shell: pwsh | |
run: Invoke-Build -File .\src\PSSimpleConfig.build.ps1 | |
- name: Upload pester results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pester-results | |
path: .\src\Artifacts\testOutput | |
if-no-files-found: warn | |
- name: Upload zip module archive build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: zip-archive | |
path: .\src\Archive | |
if-no-files-found: warn |