-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (67 loc) · 2.36 KB
/
Copy pathtest-chocolatey.yml
File metadata and controls
79 lines (67 loc) · 2.36 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
name: Test Chocolatey Package
on:
pull_request:
paths:
- 'packaging/chocolatey/**'
- '.github/workflows/test-chocolatey.yml'
push:
branches: [main]
paths:
- 'packaging/chocolatey/**'
- '.github/workflows/test-chocolatey.yml'
jobs:
test-chocolatey:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26'
- name: Build binary for testing
run: go build -o packaging/chocolatey/tools/gro.exe ./cmd/gro
- name: Prepare test package
shell: pwsh
working-directory: packaging/chocolatey
run: |
# Replace placeholder version with test version (must not be prerelease)
(Get-Content google-readonly.nuspec) `
-replace '<version>0.0.0</version>', '<version>0.0.1</version>' |
Set-Content google-readonly.nuspec
# Create a simple install script that uses the local binary
# (the real script downloads from GitHub, but we test structure here)
@'
$ErrorActionPreference = 'Stop'
$toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
# Binary is already in tools/ from CI build
Write-Host "google-readonly installed from local build for testing"
'@ | Set-Content tools/chocolateyInstall.ps1
- name: Pack Chocolatey package
shell: pwsh
working-directory: packaging/chocolatey
run: choco pack
- name: Install package locally
shell: pwsh
working-directory: packaging/chocolatey
run: choco install google-readonly -dv -s . --force
- name: Verify installation
shell: pwsh
run: |
Write-Host "Testing gro --version..."
gro --version
if ($LASTEXITCODE -ne 0) {
Write-Error "gro --version failed"
exit 1
}
Write-Host "gro is working!"
- name: Test uninstall
shell: pwsh
run: |
choco uninstall google-readonly -y
# Verify gro is no longer available
$groPath = Get-Command gro -ErrorAction SilentlyContinue
if ($groPath) {
Write-Error "gro should not be available after uninstall"
exit 1
}
Write-Host "Uninstall successful!"