-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (66 loc) · 2.45 KB
/
Copy pathci.yml
File metadata and controls
74 lines (66 loc) · 2.45 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
67
68
69
70
71
72
73
74
name: CI
on:
push:
branches: [main]
paths-ignore:
- '.dartai/**'
- '.dartai-locks.json'
- 'docs/spikes/**'
- 'docs/solutions/**'
- '**/*.md'
pull_request:
branches: [main]
paths-ignore:
- '.dartai/**'
- '.dartai-locks.json'
- 'docs/spikes/**'
- 'docs/solutions/**'
- '**/*.md'
# Cancel earlier runs on the same ref/PR when new commits arrive.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Build and stage PsBash.Cmdlets binary module (+ deps)
shell: pwsh
run: |
# The psm1 probes $PSScriptRoot for PsBash.Cmdlets.dll and loads it so
# Import-Module PsBash can resolve the migrated Invoke-Bash* binary cmdlets.
# That assembly in turn depends on PsBash.Transpiler.dll and Parlot.dll, so
# ALL THREE must sit next to PsBash.psd1 — otherwise the load fails with
# "Could not load file or assembly 'PsBash.Transpiler'" (the bug that kept
# this job red on every commit). Mirrors publish.yml's Pester staging.
# net8.0 loads on both the net8 and net10 pwsh runtimes.
dotnet build src/PsBash.Cmdlets/PsBash.Cmdlets.csproj -c Debug --framework net8.0 -nologo
if ($LASTEXITCODE -ne 0) { throw "PsBash.Cmdlets net8.0 build failed" }
$bin = "src/PsBash.Cmdlets/bin/Debug/net8.0"
foreach ($dll in @('PsBash.Cmdlets.dll', 'PsBash.Transpiler.dll', 'Parlot.dll')) {
$src = Join-Path $bin $dll
if (-not (Test-Path $src)) { throw "missing $src after build" }
Copy-Item $src src/PsBash.Module/ -Force
Write-Host "Staged $dll -> src/PsBash.Module/"
}
- name: Install Pester
shell: pwsh
run: |
Install-Module -Name Pester -MinimumVersion 5.0 -Force -Scope CurrentUser
- name: Run Pester Tests
shell: pwsh
run: |
$config = New-PesterConfiguration
$config.Run.Path = './tests'
$config.Output.Verbosity = 'Detailed'
$config.Run.Exit = $true
Invoke-Pester -Configuration $config