Skip to content

fix: post validation for window #42

fix: post validation for window

fix: post validation for window #42

name: Cross-Platform Tests
on:
push:
branches: [main, develop]
pull_request:
jobs:
test:
timeout-minutes: 90
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: ['20.x', '22.x']
fail-fast: true
runs-on: ${{ matrix.os }}
name: Test on ${{ matrix.os }} (Node ${{ matrix.node-version }})
env:
CI: true
CRF_NPM_INSTALL_TIMEOUT_MS: '600000'
CRF_NPM_BUILD_TIMEOUT_MS: '600000'
CRF_TEST_HOOK_TIMEOUT_MS: '300000'
CRF_CLI_TEST_TIMEOUT_MS: '30000'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Run unit tests
timeout-minutes: 20
run: npm test -- --bail=1 src/__tests__/ --exclude "src/__tests__/integration/**"
- name: Run integration tests
timeout-minutes: 45
run: npm test -- --bail=1 src/__tests__/integration/
- name: Run cross-platform tests
timeout-minutes: 15
run: npm test -- --bail=1 src/__tests__/integration/cross-platform-cli.test.ts
- name: Run E2E CLI tests
timeout-minutes: 15
run: npm test -- --bail=1 src/__tests__/integration/e2e-cli.test.ts
- name: Run E2E scenario tests
timeout-minutes: 20
run: npm test -- --bail=1 src/__tests__/integration/e2e-scenarios.test.ts
- name: Run config builder comprehensive tests
timeout-minutes: 15
run: npm test -- --bail=1 src/__tests__/config-builder.test.ts
- name: Run template system comprehensive tests
timeout-minutes: 15
run: npm test -- --bail=1 src/__tests__/integration/template-loading.test.ts
- name: Run generator comprehensive tests
timeout-minutes: 15
run: npm test -- --bail=1 src/__tests__/integration/generator.test.ts
- name: Test CLI command (Unix)
if: runner.os != 'Windows'
run: |
# Test that the CLI can be invoked
node dist/index.js --version || true
node dist/index.js --help || true
- name: Test CLI command (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
# Test that the CLI can be invoked
try { node dist/index.js --version } catch { $true | Out-Null }
try { node dist/index.js --help } catch { $true | Out-Null }
- name: Upload coverage
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v4
with:
files: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
e2e-scaffold-test:
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
name: E2E Scaffold 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.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Test scaffolding (Unix)
if: runner.os != 'Windows'
run: |
# Create a temporary directory for testing
TEST_DIR=$(mktemp -d)
echo "Testing in: $TEST_DIR"
# Note: Actual scaffolding test would be interactive
# For now, just verify the CLI can be invoked
node dist/index.js --help
echo "[OK] CLI is executable and responsive"
- name: Test scaffolding (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
# Create a temporary directory for testing
$TEST_DIR = New-TemporaryFile | ForEach-Object { Remove-Item $_; New-Item -ItemType Directory -Path $_ }
Write-Output "Testing in: $TEST_DIR"
# Verify the CLI can be invoked
node dist/index.js --help
Write-Output "[OK] CLI is executable and responsive"
lint:
runs-on: ubuntu-latest
timeout-minutes: 15
name: Lint and Format Check
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
build-artifacts:
needs: [test, e2e-scaffold-test, lint]
runs-on: ubuntu-latest
timeout-minutes: 15
name: Verify Build Artifacts
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Check dist files exist
run: |
if [ ! -f "dist/index.js" ]; then
echo "dist/index.js not found"
exit 1
fi
echo "[OK] Build artifacts verified"
shell: bash
- name: Verify TypeScript definitions
run: |
if [ ! -f "dist/index.d.ts" ]; then
echo "dist/index.d.ts not found"
exit 1
fi
echo "[OK] TypeScript definitions verified"
shell: bash