@@ -3,47 +3,49 @@ name: Test Installation Script
3
3
on :
4
4
push :
5
5
paths :
6
- - ' install.ps1'
7
- - ' .github/workflows/test-install.yml'
6
+ - " install.ps1"
7
+ - " install.sh"
8
+ - " .github/workflows/test-install.yml"
8
9
pull_request :
9
10
paths :
10
- - ' install.ps1'
11
- - ' .github/workflows/test-install.yml'
11
+ - " install.ps1"
12
+ - " install.sh"
13
+ - " .github/workflows/test-install.yml"
12
14
release :
13
15
14
16
jobs :
15
- test-install :
17
+ test-install-windows :
16
18
runs-on : windows-latest
17
19
strategy :
18
20
fail-fast : false
19
-
21
+
20
22
steps :
21
23
- uses : actions/checkout@v3
22
24
23
25
- name : Run installation script
24
26
run : |
25
27
.\\install.ps1
26
28
shell : powershell
27
-
29
+
28
30
- name : Verify installation
29
31
run : |
30
32
# Check if envfetch directory exists
31
33
$envfetchPath = "$env:APPDATA\envfetch"
32
34
if (-not (Test-Path $envfetchPath)) {
33
35
throw "envfetch directory not found"
34
36
}
35
-
37
+
36
38
# Check if executable exists
37
39
if (-not (Test-Path "$envfetchPath\envfetch.exe")) {
38
40
throw "envfetch.exe not found"
39
41
}
40
-
42
+
41
43
# Verify PATH
42
44
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
43
45
if ($userPath -notlike "*$envfetchPath*") {
44
46
throw "envfetch not found in PATH"
45
47
}
46
-
48
+
47
49
# Try to run envfetch (this should at least not crash)
48
50
$env:Path = [Environment]::GetEnvironmentVariable("Path", "User")
49
51
$result = envfetch --version
55
57
- name : Cleanup
56
58
run : |
57
59
Remove-Item -Path "$env:APPDATA\envfetch" -Recurse -Force -ErrorAction SilentlyContinue
58
- shell : powershell
60
+ shell : powershell
61
+
62
+ test-install-unix :
63
+ runs-on : ${{ matrix.os }}
64
+ strategy :
65
+ fail-fast : false
66
+ matrix :
67
+ os : [ubuntu-latest, macos-latest]
68
+
69
+ steps :
70
+ - uses : actions/checkout@v3
71
+
72
+ - name : Run installation script
73
+ run : |
74
+ chmod +x ./install.sh
75
+ ./install.sh
76
+ shell : bash
77
+
78
+ - name : Verify installation
79
+ run : |
80
+ # Check if executable exists
81
+ if [ ! -f "/usr/local/bin/envfetch" ]; then
82
+ echo "envfetch not found in /usr/local/bin"
83
+ exit 1
84
+ fi
85
+
86
+ # Check if executable permissions are set
87
+ if [ ! -x "/usr/local/bin/envfetch" ]; then
88
+ echo "envfetch is not executable"
89
+ exit 1
90
+ fi
91
+
92
+ # Try to run envfetch
93
+ result=$(envfetch --version)
94
+ if [ $? -ne 0 ]; then
95
+ echo "envfetch failed to run"
96
+ exit 1
97
+ fi
98
+ shell : bash
99
+
100
+ - name : Cleanup
101
+ run : |
102
+ sudo rm -f /usr/local/bin/envfetch
103
+ shell : bash
0 commit comments