Merge pull request #41 from GraphDone/feature/test-coverage-gaps #160
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Comprehensive Test Suite | |
| # Complements ci.yml (Node 20 + full-stack smoke gate) by proving the real | |
| # unit suites also pass on the minimum supported Node version, and by | |
| # validating the installer + deployment config. Runs daily so flakes and | |
| # dependency drift surface even without a push. | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| schedule: | |
| - cron: '0 2 * * *' # daily 02:00 UTC | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| # Real unit suites across the supported Node range (engines: >=18) | |
| unit-matrix: | |
| name: Unit Tests (Node ${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: ['18.x', '20.x'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| # npm install (not ci) avoids the rollup optional-deps bug (npm/cli#4828) | |
| - name: Install dependencies | |
| run: npm install --legacy-peer-deps | |
| - name: Run all unit suites (core, web, server, mcp-server) | |
| run: npm run test | |
| # Genuinely-real checks: the installer exists, deployment compose parses | |
| installer-and-deploy-config: | |
| name: Installer & Deploy Config | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Installation script present and executable | |
| run: | | |
| test -f public/install.sh || { echo "::error::public/install.sh missing"; exit 1; } | |
| test -x public/install.sh || echo "::warning::public/install.sh is not marked executable" | |
| echo "✅ installer present" | |
| - name: Production docker compose config is valid | |
| run: | | |
| docker compose -f deployment/docker-compose.yml config > /dev/null \ | |
| && echo "✅ deployment/docker-compose.yml is valid" \ | |
| || { echo "::error::deployment/docker-compose.yml failed to parse"; exit 1; } | |
| # Honest PR comment derived from real job outcomes (no fabricated numbers) | |
| report: | |
| name: Report | |
| runs-on: ubuntu-latest | |
| needs: [unit-matrix, installer-and-deploy-config] | |
| if: always() && github.event_name == 'pull_request' | |
| steps: | |
| - name: Comment PR with real results | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const unit = '${{ needs.unit-matrix.result }}'; | |
| const cfg = '${{ needs.installer-and-deploy-config.result }}'; | |
| const mark = (r) => r === 'success' ? '✅ passed' : (r === 'skipped' ? '⏭️ skipped' : '❌ ' + r); | |
| const body = [ | |
| '## 🧪 Comprehensive Test Suite', | |
| '', | |
| `- **Unit suites (Node 18.x & 20.x)** — core, web, server, mcp-server: ${mark(unit)}`, | |
| `- **Installer & deploy config**: ${mark(cfg)}`, | |
| '', | |
| '_Full-stack smoke gate runs in the **CI** workflow._', | |
| ].join('\n'); | |
| await github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body, | |
| }); |