fix: resolve task validation, project reset, and provider model issues #11
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: Test Suite | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| env: | |
| NODE_VERSION: '20' | |
| PNPM_VERSION: '8' | |
| jobs: | |
| # ========================================== | |
| # Unit Tests | |
| # ========================================== | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run unit tests | |
| run: pnpm test:unit | |
| env: | |
| CI: true | |
| - name: Upload unit test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: unit-test-results | |
| path: test-results/ | |
| retention-days: 7 | |
| # ========================================== | |
| # Integration Tests | |
| # ========================================== | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run integration tests | |
| run: pnpm test:integration | |
| env: | |
| CI: true | |
| - name: Upload integration test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: integration-test-results | |
| path: test-results/ | |
| retention-days: 7 | |
| # ========================================== | |
| # Coverage Report | |
| # ========================================== | |
| coverage: | |
| name: Test Coverage | |
| runs-on: ubuntu-latest | |
| needs: [unit-tests] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Generate coverage report | |
| run: pnpm test:coverage | |
| env: | |
| CI: true | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage/ | |
| retention-days: 7 | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| files: ./coverage/lcov.info | |
| fail_ci_if_error: false | |
| verbose: true | |
| # ========================================== | |
| # E2E Tests | |
| # ========================================== | |
| e2e-tests: | |
| name: E2E Tests (${{ matrix.browser }}) | |
| runs-on: ubuntu-latest | |
| needs: [unit-tests] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| browser: [chromium, firefox, webkit] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Install Playwright browsers | |
| run: pnpm exec playwright install --with-deps ${{ matrix.browser }} | |
| - name: Build application | |
| run: pnpm build | |
| - name: Run E2E tests | |
| run: pnpm test:e2e --project=${{ matrix.browser }} | |
| env: | |
| CI: true | |
| PLAYWRIGHT_BASE_URL: http://localhost:5173 | |
| - name: Upload E2E test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: e2e-test-results-${{ matrix.browser }} | |
| path: | | |
| playwright-report/ | |
| test-results/ | |
| retention-days: 7 | |
| - name: Upload E2E screenshots | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: e2e-screenshots-${{ matrix.browser }} | |
| path: test-results/ | |
| retention-days: 7 | |
| # ========================================== | |
| # Performance Tests | |
| # ========================================== | |
| performance-tests: | |
| name: Performance Tests | |
| runs-on: ubuntu-latest | |
| needs: [unit-tests] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run performance tests | |
| run: pnpm test:perf | |
| env: | |
| CI: true | |
| - name: Upload performance test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: performance-test-results | |
| path: test-results/ | |
| retention-days: 7 | |
| # ========================================== | |
| # Component Tests | |
| # ========================================== | |
| component-tests: | |
| name: Component Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run component tests | |
| run: pnpm test:components | |
| env: | |
| CI: true | |
| - name: Upload component test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: component-test-results | |
| path: test-results/ | |
| retention-days: 7 | |
| # ========================================== | |
| # Type Check | |
| # ========================================== | |
| type-check: | |
| name: Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run type check | |
| run: pnpm type-check | |
| # ========================================== | |
| # Lint Check | |
| # ========================================== | |
| lint: | |
| name: Lint Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run lint | |
| run: pnpm lint | |
| # ========================================== | |
| # Test Summary | |
| # ========================================== | |
| test-summary: | |
| name: Test Summary | |
| runs-on: ubuntu-latest | |
| needs: | |
| - unit-tests | |
| - integration-tests | |
| - coverage | |
| - e2e-tests | |
| - performance-tests | |
| - component-tests | |
| - type-check | |
| - lint | |
| if: always() | |
| steps: | |
| - name: Check test results | |
| run: | | |
| echo "## Test Results Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| if [ "${{ needs.unit-tests.result }}" == "success" ]; then | |
| echo "✅ Unit Tests: Passed" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "❌ Unit Tests: Failed" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [ "${{ needs.integration-tests.result }}" == "success" ]; then | |
| echo "✅ Integration Tests: Passed" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "❌ Integration Tests: Failed" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [ "${{ needs.coverage.result }}" == "success" ]; then | |
| echo "✅ Coverage: Passed" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "❌ Coverage: Failed" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [ "${{ needs.e2e-tests.result }}" == "success" ]; then | |
| echo "✅ E2E Tests: Passed" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "❌ E2E Tests: Failed" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [ "${{ needs.performance-tests.result }}" == "success" ]; then | |
| echo "✅ Performance Tests: Passed" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "❌ Performance Tests: Failed" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [ "${{ needs.component-tests.result }}" == "success" ]; then | |
| echo "✅ Component Tests: Passed" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "❌ Component Tests: Failed" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [ "${{ needs.type-check.result }}" == "success" ]; then | |
| echo "✅ Type Check: Passed" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "❌ Type Check: Failed" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [ "${{ needs.lint.result }}" == "success" ]; then | |
| echo "✅ Lint: Passed" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "❌ Lint: Failed" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Fail if any test failed | |
| if: | | |
| needs.unit-tests.result == 'failure' || | |
| needs.integration-tests.result == 'failure' || | |
| needs.e2e-tests.result == 'failure' || | |
| needs.type-check.result == 'failure' || | |
| needs.lint.result == 'failure' | |
| run: exit 1 |