This document describes the GitHub Actions workflows configured for this project.
The main CI pipeline that runs on every push and pull request to the master branch.
Features:
- Unit tests for Chrome Extension components and stores
- E2E tests with Puppeteer
- Build verification
- Coverage reporting for store tests
Jobs:
unit-tests: Runs component and store tests with coveragee2e-tests: Runs end-to-end tests with Chrome browserbuild-verification: Verifies the extension builds correctly
Automatically attempts to fix CI failures by creating fix branches and PRs.
Trigger: Runs after CI Pipeline completes with failure status Features:
- Uses Cursor AI to analyze and fix CI failures
- Creates persistent fix branches
- Generates PR comments with compare links
NEW WORKFLOW - Automatically ensures store test coverage reaches 100%.
Trigger: Runs after CI Pipeline completes successfully Features:
- Downloads and analyzes coverage artifacts from CI Pipeline
- Parses lcov.info coverage data
- Identifies uncovered code paths
- Generates additional tests automatically
- Creates pull requests with test improvements
- Prevents duplicate PRs for the same coverage issue
-
Coverage Analysis: Downloads coverage artifacts from the CI Pipeline and parses the lcov.info file to determine current coverage percentages.
-
Gap Identification: Identifies specific uncovered lines in store files that need additional tests.
-
Test Generation: Automatically generates test files for uncovered code paths using AI assistance.
-
Verification: Runs the tests to ensure they pass and improve coverage.
-
PR Creation: Creates a pull request with the generated tests, but only if:
- Coverage is below 100%
- No existing coverage improvement PR exists
- The generated tests actually improve coverage
The workflow enforces 100% coverage for:
- Lines: All executable lines must be covered
- Functions: All functions must be called in tests
- Branches: All conditional branches must be tested
The workflow uses the following npm scripts:
npm run test:stores- Runs store testsnpm run test:stores:coverage- Runs store tests with coverage reporting
Coverage is configured in chrome-extension/package.json:
"test:stores:coverage": "vitest --coverage --run src/tests/stores/ --coverage.include='src/stores/**/*Store.js'"The workflow generates several artifacts:
coverage-analysis-report- Contains coverage analysis and test suggestions- Coverage reports in HTML and LCOV formats
The workflow requires the following GitHub permissions:
contents: write- To create branches and commitspull-requests: write- To create and manage PRsactions: write- To trigger workflowschecks: write- To create check runsissues: write- To create tracking issues
Required secrets:
CURSOR_API_KEY- For AI-powered test generationGITHUB_TOKEN- Automatically provided by GitHub Actions
GitHub Actions are enabled by default when the workflow files are present in .github/workflows/.
Add the following secrets in your repository settings:
CURSOR_API_KEY: Your Cursor API key for AI test generationGEMINI_API_KEY: Your Gemini API key for E2E tests
The workflows are configured to trigger on:
- Push to master branch
- Pull requests to master branch
- Workflow completion events
You can monitor workflow runs in the GitHub Actions tab of your repository.
-
Coverage Not Generated: Ensure the CI Pipeline is running the coverage step and uploading artifacts.
-
Permission Errors: Verify that the GitHub token has the required permissions.
-
Test Generation Fails: Check that the CURSOR_API_KEY secret is properly configured.
-
Duplicate PRs: The workflow prevents duplicate coverage PRs by checking for existing open PRs.
The workflow includes extensive logging and debugging information:
- Coverage percentages are logged at each step
- Test generation progress is tracked
- PR creation status is reported
-
Review Generated Tests: Always review automatically generated tests before merging.
-
Monitor Coverage Trends: Use the coverage reports to track coverage improvements over time.
-
Maintain Test Quality: Ensure generated tests follow the same quality standards as manual tests.
-
Regular Cleanup: Periodically clean up old coverage improvement branches and PRs.
Potential improvements to consider:
- Integration with code quality tools
- Custom coverage thresholds per file
- Integration with project management tools
- Enhanced test generation with more sophisticated AI prompts