forked from PowerShell/ConsoleGuiTools
-
-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (58 loc) · 2.04 KB
/
Copy pathci-test.yml
File metadata and controls
66 lines (58 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: CI Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
merge_group:
types: [ checks_requested ]
jobs:
ci:
name: dotnet
strategy:
matrix:
os: [ windows-latest, macos-latest, ubuntu-latest ]
runs-on: ${{ matrix.os }}
env:
DOTNET_NOLOGO: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dotnet
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
cache: true
cache-dependency-path: '**/*.csproj'
# The module targets PS 7.6+ (net10.0), and the Pester tests Import-Module
# it. GitHub runners ship PS 7.4, which rejects the manifest, so install
# PS 7.6 and put it ahead of the bundled pwsh on PATH.
- name: Install PowerShell 7.6+
shell: bash
run: |
dotnet tool install --global --version "7.6.*" PowerShell
echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"
- name: Verify PowerShell version
shell: pwsh
run: |
"Using PowerShell $($PSVersionTable.PSVersion) at $((Get-Command pwsh).Source)"
if ($PSVersionTable.PSVersion -lt [version]'7.6') {
throw "Expected PowerShell 7.6+, got $($PSVersionTable.PSVersion)"
}
- name: Install PSResources
shell: pwsh
run: ./tools/installPSResources.ps1
# Dev-loop CI builds and runs the xUnit suite. Packaging/publishing
# (Publish-PSResource) is a release activity that validates the manifest
# against the running PowerShell host — the module targets PS 7.6+, but
# the GitHub runners ship PS 7.4, so that step lives in release.yml (main).
- name: Build and test
shell: pwsh
run: Invoke-Build -Configuration Release Build, Test
- name: Upload module
if: always()
uses: actions/upload-artifact@v4
with:
name: PSTui-module-${{ matrix.os }}
path: module