-
Notifications
You must be signed in to change notification settings - Fork 3
103 lines (87 loc) · 2.59 KB
/
test-install.yml
File metadata and controls
103 lines (87 loc) · 2.59 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Test Installation Script
on:
workflow_call:
push:
paths:
- "install.ps1"
- "install.sh"
- ".github/workflows/test-install.yml"
pull_request:
paths:
- "install.ps1"
- "install.sh"
- ".github/workflows/test-install.yml"
jobs:
test-install-windows:
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
test-install-unix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Run installation script
run: |
chmod +x ./install.sh
./install.sh
shell: bash
- name: Verify installation
run: |
# Check if executable exists
if [ ! -f "/usr/local/bin/envfetch" ]; then
echo "envfetch not found in /usr/local/bin"
exit 1
fi
# Check if executable permissions are set
if [ ! -x "/usr/local/bin/envfetch" ]; then
echo "envfetch is not executable"
exit 1
fi
# Try to run envfetch
result=$(envfetch --version)
if [ $? -ne 0 ]; then
echo "envfetch failed to run"
exit 1
fi
shell: bash
- name: Cleanup
run: |
sudo rm -f /usr/local/bin/envfetch
shell: bash