-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.56 KB
/
test-install.yml
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
name: Test Installation Script
on:
push:
paths:
- 'install.ps1'
- '.github/workflows/test-install.yml'
pull_request:
paths:
- 'install.ps1'
- '.github/workflows/test-install.yml'
release:
jobs:
test-install:
runs-on: windows-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Run installation script
run: |
.\\install.ps1
shell: powershell
- name: Verify installation
run: |
# Check if envfetch directory exists
$envfetchPath = "$env:APPDATA\envfetch"
if (-not (Test-Path $envfetchPath)) {
throw "envfetch directory not found"
}
# Check if executable exists
if (-not (Test-Path "$envfetchPath\envfetch.exe")) {
throw "envfetch.exe not found"
}
# Verify PATH
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($userPath -notlike "*$envfetchPath*") {
throw "envfetch not found in PATH"
}
# Try to run envfetch (this should at least not crash)
$env:Path = [Environment]::GetEnvironmentVariable("Path", "User")
$result = envfetch --version
if ($LASTEXITCODE -ne 0) {
throw "envfetch failed to run"
}
shell: powershell
- name: Cleanup
run: |
Remove-Item -Path "$env:APPDATA\envfetch" -Recurse -Force -ErrorAction SilentlyContinue
shell: powershell