-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (74 loc) · 2.49 KB
/
Copy pathci.yml
File metadata and controls
84 lines (74 loc) · 2.49 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
75
76
77
78
79
80
81
82
83
84
name: CI Pipeline
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
ci-pipeline:
name: CI Pipeline
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Pester
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
if (-not (Get-Module -ListAvailable -Name Pester | Where-Object { $_.Version -ge [version]'5.0.0' })) {
Install-Module -Name Pester -Scope CurrentUser -Force -SkipPublisherCheck -MinimumVersion 5.0.0
}
- name: Run full CLI contract tests
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
Invoke-Pester -Path @(
'./tests/CdevCliContract.Tests.ps1',
'./tests/CdevCliInstallerContract.Tests.ps1',
'./tests/CdevCliLinuxContract.Tests.ps1',
'./tests/CdevCliCiContract.Tests.ps1',
'./tests/CdevCliSyncGuardContract.Tests.ps1',
'./tests/CdevCliForceAlignOpsContract.Tests.ps1',
'./tests/CdevCliRuntimeImagePublishContract.Tests.ps1'
) -CI -Output Detailed
cli-contract:
name: CLI Contract
runs-on: ubuntu-latest
needs: [ci-pipeline]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate CLI help surface
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
& pwsh -NoProfile -File ./scripts/Invoke-CdevCli.ps1 help
if ($LASTEXITCODE -ne 0) { throw 'CLI help command failed.' }
provenance-contract:
name: Provenance Contract
runs-on: ubuntu-latest
needs: [cli-contract]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Package release assets and validate provenance files
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$out = Join-Path $env:RUNNER_TEMP 'cli-release'
& pwsh -NoProfile -File ./scripts/Invoke-CdevCli.ps1 release package --output-root $out
if ($LASTEXITCODE -ne 0) { throw 'release package command failed.' }
foreach ($asset in @(
'cdev-cli-win-x64.zip',
'cdev-cli-linux-x64.tar.gz',
'cdev-cli.spdx.json',
'cdev-cli.slsa.json'
)) {
$path = Join-Path $out $asset
if (-not (Test-Path -LiteralPath $path -PathType Leaf)) {
throw "Missing release asset: $path"
}
}