The --yes guard counted the conditionally-skipped seederTier prompt as a missing required value, so `create <id> --architecture polling ... --yes` failed even though seeders only apply to websocket plugins. The guard now only requires seederTier when the resolved architecture is websocket. This bug shipped in 1.3.0 and was missed in manual UAT (the polling case was exercised interactively, not with --yes). The new test suite caught it. Also in this change: - Add packages/wwv-cli/test/create.test.mjs: 9 integration tests that spawn the built CLI into temp dirs and assert the scaffolded tree (polling vs websocket, community vs private seeder tier, billboard/model/point render, --core, kebab-id naming, icon mapping, and the --yes / invalid-flag / duplicate-dir failure guards). Uses Node's built-in test runner, no new deps. - Add .github/workflows/cli.yml: path-scoped to packages/wwv-cli, runs build (tsc) + the integration tests. Fast versus the full app suite. - Add paths-ignore for packages/wwv-cli to the heavy app workflows (ci, playwright, docker-publish, test-setup-scripts, test-local-dev push) so a CLI-only change runs just cli.yml instead of the whole suite. - Bump CLI to 1.3.1 and add a test script.
127 lines
3.3 KiB
YAML
127 lines
3.3 KiB
YAML
name: Test Setup Scripts
|
|
|
|
# CLI-only changes are covered by cli.yml; skip setup-script tests for them.
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
paths-ignore:
|
|
- "packages/wwv-cli/**"
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
paths-ignore:
|
|
- "packages/wwv-cli/**"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test-bash:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Start local HTTP server
|
|
run: |
|
|
python3 -m http.server 8080 &
|
|
sleep 2 # Wait for server to start
|
|
|
|
- name: Patch setup.sh to use local server
|
|
run: |
|
|
sed -i 's|https://raw.githubusercontent.com/silvertakana/worldwideview/main|http://localhost:8080|g' self-host/setup.sh
|
|
|
|
- name: Run setup.sh
|
|
run: |
|
|
cd self-host
|
|
bash setup.sh
|
|
|
|
- name: Verify .env generation
|
|
run: |
|
|
cd self-host
|
|
if [ ! -f .env ]; then
|
|
echo ".env file was not created"
|
|
exit 1
|
|
fi
|
|
|
|
if ! grep -q "^AUTH_SECRET=[a-f0-9]\{64\}$" .env; then
|
|
echo "AUTH_SECRET was not generated correctly or is missing"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Verify docker-compose.yml download
|
|
run: |
|
|
cd self-host
|
|
if [ ! -f docker-compose.yml ]; then
|
|
echo "docker-compose.yml was not downloaded"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Verify Docker containers are running
|
|
run: |
|
|
cd self-host
|
|
docker compose ps
|
|
if ! docker compose ps | grep -q "Up"; then
|
|
echo "Docker containers failed to start"
|
|
exit 1
|
|
fi
|
|
|
|
test-powershell:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Start local HTTP server
|
|
run: |
|
|
python3 -m http.server 8080 &
|
|
sleep 2 # Wait for server to start
|
|
|
|
- name: Patch setup.ps1 to use local server
|
|
run: |
|
|
sed -i 's|https://raw.githubusercontent.com/silvertakana/worldwideview/main|http://localhost:8080|g' self-host/setup.ps1
|
|
|
|
- name: Run setup.ps1
|
|
run: |
|
|
cd self-host
|
|
pwsh ./setup.ps1
|
|
|
|
- name: Verify .env generation
|
|
run: |
|
|
cd self-host
|
|
if [ ! -f .env ]; then
|
|
echo ".env file was not created"
|
|
exit 1
|
|
fi
|
|
|
|
if ! grep -q "^AUTH_SECRET=[a-f0-9]\{64\}$" .env; then
|
|
echo "AUTH_SECRET was not generated correctly or is missing"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Verify docker-compose.yml download
|
|
run: |
|
|
cd self-host
|
|
if [ ! -f docker-compose.yml ]; then
|
|
echo "docker-compose.yml was not downloaded"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Verify Docker containers are running
|
|
run: |
|
|
cd self-host
|
|
docker compose ps
|
|
if ! docker compose ps | grep -q "Up"; then
|
|
echo "Docker containers failed to start"
|
|
exit 1
|
|
fi
|