Skip to content

Add scroll indicator to homepage for improved navigation #22

Add scroll indicator to homepage for improved navigation

Add scroll indicator to homepage for improved navigation #22

Workflow file for this run

name: Test Smoke
on:
push:
branches:
- main
- 'release/**'
tags:
- 'v*'
pull_request:
branches:
- main
workflow_dispatch:
jobs:
test-smoke:
strategy:
fail-fast: false
matrix:
os:
# Linux (x64)
- ubuntu-latest
- ubuntu-24.04
- ubuntu-22.04
# Windows (x64)
- windows-latest
- windows-2025
- windows-2022
# macOS Intel (x64)
- macos-15-intel
# macOS ARM64 (M1/M-series)
- macos-latest
- macos-14
- macos-15
runs-on: ${{ matrix.os }}
name: Test on ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Create npm package (simulate publish)
run: npm pack
- name: Get package filename
id: package
shell: bash
run: |
PACKAGE_FILE=$(ls nport-*.tgz)
echo "filename=$PACKAGE_FILE" >> $GITHUB_OUTPUT
echo "📦 Package: $PACKAGE_FILE"
- name: Install package globally from tarball
run: npm install -g ./${{ steps.package.outputs.filename }}
- name: Verify nport installation
run: nport -l en --version
- name: Run nport and check for errors (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
echo "Starting nport on port 3000..."
# Start nport in background and capture output
nport 3000 -l en -s test-${{ matrix.os }}-${{ github.run_id }} > nport_output.log 2>&1 &
NPORT_PID=$!
echo "nport started with PID: $NPORT_PID"
# Wait 30 seconds
echo "Waiting 30 seconds..."
sleep 30
# Check if process is still running
if kill -0 $NPORT_PID 2>/dev/null; then
echo "✅ nport is still running after 30 seconds"
PROCESS_RUNNING=true
else
echo "⚠️ nport process has stopped"
PROCESS_RUNNING=false
fi
# Stop the process
kill $NPORT_PID 2>/dev/null || true
sleep 2
kill -9 $NPORT_PID 2>/dev/null || true
# Show output
echo ""
echo "=== nport output ==="
cat nport_output.log || true
echo "===================="
# Check for critical errors in output (ignore cloudflared warnings)
# Only fail on actual nport/installation errors, not cloudflared ICMP warnings
CRITICAL_ERRORS="Failed to spawn|EACCES|ENOENT|Unsupported architecture|Unsupported platform|Installation failed|not a valid"
if grep -qiE "$CRITICAL_ERRORS" nport_output.log; then
echo ""
echo "❌ Critical errors detected in nport output!"
exit 1
fi
if [ "$PROCESS_RUNNING" = false ]; then
echo ""
echo "❌ nport process stopped unexpectedly"
exit 1
fi
echo ""
echo "✅ Test passed - no errors detected"
- name: Run nport and check for errors (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Write-Host "Starting nport on port 3000..."
# Start nport as a background job
$job = Start-Job -ScriptBlock {
nport 3000 -l en -s test-$using:env:MATRIX_OS-$using:env:RUN_ID 2>&1
}
Write-Host "nport started as job ID: $($job.Id)"
Write-Host "Waiting 30 seconds..."
Start-Sleep -Seconds 30
# Get job output
$output = Receive-Job -Job $job -ErrorAction SilentlyContinue
# Check if job is still running
if ($job.State -eq 'Running') {
Write-Host "✅ nport is still running after 30 seconds"
Stop-Job -Job $job -ErrorAction SilentlyContinue
} else {
Write-Host "⚠️ nport job state: $($job.State)"
}
Remove-Job -Job $job -Force -ErrorAction SilentlyContinue
# Show output
Write-Host ""
Write-Host "=== nport output ==="
if ($output) {
$output | ForEach-Object { Write-Host $_ }
$output | Out-File -FilePath "nport_output.log" -Encoding UTF8
} else {
Write-Host "(no output captured)"
}
Write-Host "===================="
# Check for critical errors
$criticalErrors = @(
"Failed to spawn",
"EACCES",
"ENOENT",
"Unsupported architecture",
"Unsupported platform",
"Installation failed",
"not a valid"
)
$hasErrors = $false
if ($output) {
$outputText = $output -join "`n"
foreach ($pattern in $criticalErrors) {
if ($outputText -match [regex]::Escape($pattern)) {
$hasErrors = $true
Write-Host "Found critical error: $pattern"
break
}
}
}
if ($hasErrors) {
Write-Host ""
Write-Host "❌ Critical errors detected in nport output!"
exit 1
}
Write-Host ""
Write-Host "✅ Test passed - no critical errors detected"
env:
MATRIX_OS: ${{ matrix.os }}
RUN_ID: ${{ github.run_id }}
- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: nport-logs-${{ matrix.os }}
path: |
nport_output.log
nport_error.log
retention-days: 7