|
62 | 62 | exit 1 |
63 | 63 | } |
64 | 64 |
|
| 65 | + - name: Smoke test binary from install dir |
| 66 | + shell: pwsh |
| 67 | + run: | |
| 68 | + # Simulate binary install at %APPDATA%\archgate\ |
| 69 | + $installDir = Join-Path $env:APPDATA "archgate" |
| 70 | + New-Item -Path $installDir -ItemType Directory -Force | Out-Null |
| 71 | + Copy-Item "dist/archgate-smoke-test.exe" (Join-Path $installDir "archgate.exe") |
| 72 | + $output = & (Join-Path $installDir "archgate.exe") --version 2>&1 |
| 73 | + Write-Host "archgate version from binary install dir: $output" |
| 74 | + if ($LASTEXITCODE -ne 0) { |
| 75 | + Write-Error "Binary exited with code $LASTEXITCODE" |
| 76 | + exit 1 |
| 77 | + } |
| 78 | + Remove-Item -Path $installDir -Recurse -Force -ErrorAction SilentlyContinue |
| 79 | +
|
| 80 | + - name: Smoke test binary from proto dir |
| 81 | + shell: pwsh |
| 82 | + run: | |
| 83 | + # Simulate proto install at ~/.proto/tools/archgate/<version>/ |
| 84 | + $protoDir = Join-Path $env:USERPROFILE ".proto" "tools" "archgate" "0.0.0" |
| 85 | + New-Item -Path $protoDir -ItemType Directory -Force | Out-Null |
| 86 | + Copy-Item "dist/archgate-smoke-test.exe" (Join-Path $protoDir "archgate.exe") |
| 87 | + $output = & (Join-Path $protoDir "archgate.exe") --version 2>&1 |
| 88 | + Write-Host "archgate version from proto dir: $output" |
| 89 | + if ($LASTEXITCODE -ne 0) { |
| 90 | + Write-Error "Binary exited with code $LASTEXITCODE" |
| 91 | + exit 1 |
| 92 | + } |
| 93 | + Remove-Item -Path (Join-Path $env:USERPROFILE ".proto") -Recurse -Force -ErrorAction SilentlyContinue |
| 94 | +
|
| 95 | + - name: Smoke test binary from node_modules |
| 96 | + shell: pwsh |
| 97 | + run: | |
| 98 | + # Simulate local dev dependency install |
| 99 | + $projectDir = Join-Path $env:TEMP "archgate-local-smoke" |
| 100 | + $binDir = Join-Path $projectDir "node_modules" ".bin" |
| 101 | + New-Item -Path $binDir -ItemType Directory -Force | Out-Null |
| 102 | + Set-Content -Path (Join-Path $projectDir "package.json") -Value "{}" |
| 103 | + Set-Content -Path (Join-Path $projectDir "bun.lock") -Value "" |
| 104 | + Copy-Item "dist/archgate-smoke-test.exe" (Join-Path $binDir "archgate.exe") |
| 105 | + $output = & (Join-Path $binDir "archgate.exe") --version 2>&1 |
| 106 | + Write-Host "archgate version from node_modules: $output" |
| 107 | + if ($LASTEXITCODE -ne 0) { |
| 108 | + Write-Error "Binary exited with code $LASTEXITCODE" |
| 109 | + exit 1 |
| 110 | + } |
| 111 | + Remove-Item -Path $projectDir -Recurse -Force -ErrorAction SilentlyContinue |
| 112 | +
|
65 | 113 | - name: Smoke test install.ps1 |
66 | 114 | shell: pwsh |
67 | 115 | env: |
@@ -107,13 +155,61 @@ jobs: |
107 | 155 | Remove-Item -Path $installDir -Recurse -Force -ErrorAction SilentlyContinue |
108 | 156 |
|
109 | 157 | linux: |
110 | | - name: Linux Install Script Smoke Test |
| 158 | + name: Linux Smoke Test |
111 | 159 | runs-on: ubuntu-latest |
112 | 160 | timeout-minutes: 10 |
113 | 161 | if: github.event.pull_request.draft == false |
114 | 162 | steps: |
115 | 163 | - name: Checkout code |
116 | 164 | uses: actions/checkout@v4 |
| 165 | + with: |
| 166 | + fetch-depth: 0 |
| 167 | + |
| 168 | + - uses: moonrepo/setup-toolchain@v0 |
| 169 | + with: |
| 170 | + auto-install: true |
| 171 | + |
| 172 | + - name: Install dependencies |
| 173 | + run: bun install --frozen-lockfile |
| 174 | + |
| 175 | + - name: Build Linux binary |
| 176 | + run: bun build src/cli.ts --compile --bytecode --outfile dist/archgate-smoke-test |
| 177 | + |
| 178 | + - name: Smoke test binary |
| 179 | + run: | |
| 180 | + chmod +x dist/archgate-smoke-test |
| 181 | + output=$(dist/archgate-smoke-test --version 2>&1) |
| 182 | + echo "archgate version: $output" |
| 183 | +
|
| 184 | + - name: Smoke test binary from ~/.archgate/bin/ |
| 185 | + run: | |
| 186 | + mkdir -p ~/.archgate/bin |
| 187 | + cp dist/archgate-smoke-test ~/.archgate/bin/archgate |
| 188 | + chmod +x ~/.archgate/bin/archgate |
| 189 | + output=$(~/.archgate/bin/archgate --version 2>&1) |
| 190 | + echo "archgate version from binary install dir: $output" |
| 191 | + rm -rf ~/.archgate/bin |
| 192 | +
|
| 193 | + - name: Smoke test binary from proto dir |
| 194 | + run: | |
| 195 | + mkdir -p ~/.proto/tools/archgate/0.0.0 |
| 196 | + cp dist/archgate-smoke-test ~/.proto/tools/archgate/0.0.0/archgate |
| 197 | + chmod +x ~/.proto/tools/archgate/0.0.0/archgate |
| 198 | + output=$(~/.proto/tools/archgate/0.0.0/archgate --version 2>&1) |
| 199 | + echo "archgate version from proto dir: $output" |
| 200 | + rm -rf ~/.proto/tools/archgate |
| 201 | +
|
| 202 | + - name: Smoke test binary from node_modules |
| 203 | + run: | |
| 204 | + project_dir=$(mktemp -d) |
| 205 | + mkdir -p "$project_dir/node_modules/.bin" |
| 206 | + echo '{}' > "$project_dir/package.json" |
| 207 | + touch "$project_dir/bun.lock" |
| 208 | + cp dist/archgate-smoke-test "$project_dir/node_modules/.bin/archgate" |
| 209 | + chmod +x "$project_dir/node_modules/.bin/archgate" |
| 210 | + output=$("$project_dir/node_modules/.bin/archgate" --version 2>&1) |
| 211 | + echo "archgate version from node_modules: $output" |
| 212 | + rm -rf "$project_dir" |
117 | 213 |
|
118 | 214 | - name: Smoke test install.sh |
119 | 215 | env: |
|
0 commit comments