Skip to content

Commit bf4acf3

Browse files
committed
Rewrite test-install-scripts workflow with proper tests
1 parent 146f0f6 commit bf4acf3

1 file changed

Lines changed: 24 additions & 26 deletions

File tree

.github/workflows/test-install-scripts.yaml

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ jobs:
1616
matrix:
1717
include:
1818
- os: ubuntu-latest
19+
expected_platform: linux
1920
- os: macos-latest
21+
expected_platform: macos
2022

2123
steps:
2224
- uses: actions/checkout@v6
@@ -29,12 +31,13 @@ jobs:
2931
3032
# Test help output
3133
./geodepot-install.sh --help > /dev/null
34+
echo "✓ Help output works"
3235
3336
# Test platform resolution by sourcing the script and calling functions directly
3437
echo "Testing platform resolution..."
3538
platform=$(sh -c '. ./geodepot-install.sh; resolve_platform')
36-
if [ -z "$platform" ] || [ "$platform" != "linux" ] && [ "$platform" != "macos" ]; then
37-
echo "✗ Platform detection failed: got '$platform'"
39+
if [ "$platform" != "${{ matrix.expected_platform }}" ]; then
40+
echo "✗ Platform detection failed: expected '${{ matrix.expected_platform }}', got '$platform'"
3841
exit 1
3942
fi
4043
echo "✓ Platform detection works: $platform"
@@ -66,26 +69,27 @@ jobs:
6669
--no-wrapper
6770
6871
# Verify installation
69-
case "$(uname -s)" in
70-
Linux*) PLATFORM="linux" ;;
71-
Darwin*) PLATFORM="macos" ;;
72-
*) echo "Unknown platform"; exit 1 ;;
73-
esac
74-
75-
case "$(uname -m)" in
76-
x86_64|amd64) ARCH="x86_64" ;;
77-
arm64|aarch64) ARCH="arm64" ;;
78-
*) echo "Unknown architecture"; exit 1 ;;
72+
case "${{ matrix.os }}" in
73+
ubuntu-latest)
74+
PLATFORM="linux"
75+
ARCH="x86_64"
76+
EXECUTABLE="geodepot"
77+
;;
78+
macos-latest)
79+
PLATFORM="macos"
80+
ARCH="arm64"
81+
EXECUTABLE="geodepot"
82+
;;
7983
esac
8084
8185
BUNDLE_DIR="$INSTALL_DIR/releases/1.1.0/geodepot"
8286
if [ -d "$BUNDLE_DIR" ]; then
8387
echo "✓ Bundle directory created"
84-
if [ -f "$BUNDLE_DIR/geodepot" ]; then
88+
if [ -f "$BUNDLE_DIR/$EXECUTABLE" ]; then
8589
echo "✓ Geodepot executable found"
8690
# Try to run it
87-
chmod +x "$BUNDLE_DIR/geodepot"
88-
"$BUNDLE_DIR/geodepot" --help > /dev/null 2>&1 && echo "✓ Geodepot executable works" || echo "✗ Geodepot executable failed"
91+
chmod +x "$BUNDLE_DIR/$EXECUTABLE"
92+
"$BUNDLE_DIR/$EXECUTABLE" --help > /dev/null 2>&1 && echo "✓ Geodepot executable works" || echo "✗ Geodepot executable failed"
8993
else
9094
echo "✗ Geodepot executable not found in $BUNDLE_DIR"
9195
ls -la "$BUNDLE_DIR/" || true
@@ -110,19 +114,13 @@ jobs:
110114
run: |
111115
cd packaging/install
112116
113-
# Test help output (PowerShell uses Get-Help, not -Help parameter)
117+
# Test help output - just run the script to see if it parses correctly
114118
try {
115-
Get-Help -Name .\geodepot-install.ps1 -ErrorAction SilentlyContinue | Out-Null
116-
Write-Host "✓ Help output works"
119+
.\geodepot-install.ps1 -Version "test" -NoWrapper -NoPathUpdate -ErrorAction SilentlyContinue 2>&1 | Out-Null
120+
Write-Host "✓ Script syntax is valid"
117121
} catch {
118-
# If Get-Help doesn't work, just try running the script
119-
try {
120-
.\geodepot-install.ps1 2>&1 | Out-Null
121-
Write-Host "✓ Help output works"
122-
} catch {
123-
Write-Host "✗ Help output failed: $_"
124-
exit 1
125-
}
122+
Write-Host "✗ Script syntax error: $_"
123+
exit 1
126124
}
127125
128126
- name: Test actual install from GitHub release

0 commit comments

Comments
 (0)