@@ -8,6 +8,8 @@ concurrency:
88 group : ${{ github.workflow }}-${{ github.ref }}
99 cancel-in-progress : true
1010
11+ env :
12+ ROC_NIGHTLY_VERSION : 2025-10-31-8553832
1113
1214# Do not add permissions here! Configure them at the job level!
1315permissions : {}
@@ -36,3 +38,180 @@ jobs:
3638 - run : |
3739 cd website
3840 roc check build_website.roc
41+
42+ test-install-script-unix :
43+ strategy :
44+ matrix :
45+ include :
46+ - os : ubuntu-24.04
47+ platform : linux
48+ arch : x86_64
49+ - os : ubuntu-24.04-arm
50+ platform : linux
51+ arch : arm64
52+ - os : macos-15
53+ platform : macos
54+ arch : apple_silicon
55+ - os : macos-15-intel
56+ platform : macos
57+ arch : x86_64
58+ runs-on : ${{ matrix.os }}
59+ timeout-minutes : 30
60+ steps :
61+ - uses : actions/checkout@v4
62+
63+ - name : Test install script (answer no to PATH)
64+ run : |
65+ cd website/content/installnew/install_scripts
66+ bash install_roc.sh <<< "n"
67+
68+ - name : Verify installation (no PATH)
69+ run : |
70+ cd website/content/installnew/install_scripts
71+ DIR_NAME="roc_nightly-${{ matrix.platform }}_${{ matrix.arch }}-${{ env.ROC_NIGHTLY_VERSION }}"
72+ if [ ! -d "$DIR_NAME" ]; then
73+ echo "Error: Installation directory $DIR_NAME not found"
74+ exit 1
75+ fi
76+
77+ - name : Test roc binary (no PATH)
78+ run : |
79+ cd website/content/installnew/install_scripts
80+ DIR_NAME="roc_nightly-${{ matrix.platform }}_${{ matrix.arch }}-${{ env.ROC_NIGHTLY_VERSION }}"
81+ "$DIR_NAME/roc" version
82+
83+ - name : Clean up for second test
84+ run : |
85+ cd website/content/installnew/install_scripts
86+ rm -rf roc_nightly-*
87+
88+ - name : Test install script (answer yes to PATH)
89+ run : |
90+ cd website/content/installnew/install_scripts
91+ bash install_roc.sh <<< "y"
92+
93+ - name : Verify PATH was updated
94+ run : |
95+ # Detect shell profile based on SHELL
96+ if [ -n "${SHELL:-}" ]; then
97+ case "$SHELL" in
98+ */bash) PROFILE="$HOME/.bashrc" ;;
99+ */zsh) PROFILE="$HOME/.zshrc" ;;
100+ */fish) PROFILE="$HOME/.config/fish/config.fish" ;;
101+ *) PROFILE="$HOME/.profile" ;;
102+ esac
103+ else
104+ PROFILE="$HOME/.profile"
105+ fi
106+
107+ if ! grep -q "roc_nightly-${{ matrix.platform }}_${{ matrix.arch }}-${{ env.ROC_NIGHTLY_VERSION }}" "$PROFILE"; then
108+ echo "Error: PATH not updated in $PROFILE"
109+ exit 1
110+ fi
111+ echo "✅ PATH successfully updated in $PROFILE"
112+
113+ test-install-script-windows :
114+ strategy :
115+ matrix :
116+ include :
117+ - os : windows-2022
118+ arch : x86_64
119+ proc_arch : AMD64
120+ - os : windows-2025
121+ arch : x86_64
122+ proc_arch : AMD64
123+ - os : windows-11-arm
124+ arch : arm64
125+ proc_arch : ARM64
126+
127+ runs-on : ${{ matrix.os }}
128+ timeout-minutes : 30
129+
130+ steps :
131+ - uses : actions/checkout@v4
132+
133+ - name : Test install script (answer no to PATH)
134+ shell : pwsh
135+ env :
136+ PROCESSOR_ARCHITECTURE : ${{ matrix.proc_arch }}
137+ run : |
138+ Set-Location website\content\installnew\install_scripts
139+ "n" | pwsh -ExecutionPolicy Bypass -File .\install_roc.ps1
140+
141+ - name : Verify installation (no PATH)
142+ shell : pwsh
143+ run : |
144+ Set-Location website\content\installnew\install_scripts
145+ $dirName = "roc_nightly-windows_${{ matrix.arch }}-${{ env.ROC_NIGHTLY_VERSION }}"
146+ if (-not (Test-Path $dirName)) {
147+ Write-Error "❌ Installation directory $dirName not found"
148+ } else {
149+ Write-Host "✅ Found $dirName"
150+ }
151+
152+ - name : Test roc binary (no PATH) – x86_64 only
153+ if : ${{ matrix.arch == 'x86_64' }}
154+ shell : pwsh
155+ run : |
156+ Set-Location website\content\installnew\install_scripts
157+ $dirName = "roc_nightly-windows_x86_64-${{ env.ROC_NIGHTLY_VERSION }}"
158+ $rocPath = Join-Path $dirName "roc.exe"
159+ if (-not (Test-Path $rocPath)) {
160+ Write-Host "❌ roc.exe not found at $rocPath"
161+ Write-Host "Contents of ${dirName}:"
162+ Get-ChildItem $dirName -ErrorAction SilentlyContinue | ForEach-Object { Write-Host " $_" }
163+ exit 1
164+ } else {
165+ Write-Host "Running roc.exe version..."
166+ & $rocPath version
167+ }
168+
169+ - name : Clean up for second test
170+ shell : pwsh
171+ run : |
172+ Set-Location website\content\installnew\install_scripts
173+ Get-Item .\roc_nightly-* -ErrorAction SilentlyContinue | Remove-Item -Recurse -Force
174+ Write-Host "🧹 Cleaned up previous installation directories"
175+
176+ - name : Test install script (answer yes to PATH)
177+ shell : pwsh
178+ env :
179+ PROCESSOR_ARCHITECTURE : ${{ matrix.proc_arch }}
180+ run : |
181+ Set-Location website\content\installnew\install_scripts
182+ "y" | pwsh -ExecutionPolicy Bypass -File .\install_roc.ps1
183+
184+ - name : Verify PATH was updated
185+ shell : pwsh
186+ env :
187+ PROCESSOR_ARCHITECTURE : ${{ matrix.proc_arch }}
188+ run : |
189+ $dirName = "roc_nightly-windows_${{ matrix.arch }}-${{ env.ROC_NIGHTLY_VERSION }}"
190+
191+ # The script uses SetEnvironmentVariable("Path", "User")
192+ $userPath = [System.Environment]::GetEnvironmentVariable("Path", "User")
193+
194+ if ([string]::IsNullOrEmpty($userPath)) {
195+ Write-Error "❌ User PATH is empty or not readable"
196+ exit 1
197+ }
198+
199+ if ($userPath -notlike "*$dirName*") {
200+ Write-Error "❌ PATH not updated with $dirName"
201+ exit 1
202+ } else {
203+ Write-Host "✅ PATH successfully updated with $dirName"
204+ }
205+
206+ - name : Test roc binary (after PATH update)
207+ shell : pwsh
208+ run : |
209+ $dirName = "roc_nightly-windows_${{ matrix.arch }}-${{ env.ROC_NIGHTLY_VERSION }}"
210+ $rocPath = Join-Path $PWD "website\content\installnew\install_scripts\$dirName\roc.exe"
211+
212+ # Pull the updated user PATH and merge into current session
213+ $userPath = [System.Environment]::GetEnvironmentVariable("Path", "User")
214+ $env:PATH = "$userPath;$env:PATH"
215+
216+ Write-Host "Running roc.exe version..."
217+ roc.exe version
0 commit comments