Files
claude-task-master/tasks/task_041.txt
Ralph Khreish a56a3628b3 CHORE: Add CI for making sure PRs don't break things (#89)
* fix: add CI for better control of regressions during PRs

* fix: slight readme improvement

* chore: fix CI

* cleanup

* fix: duplicate workflow trigger
2025-04-03 16:01:58 +02:00

90 lines
3.1 KiB
Plaintext

# Task ID: 41
# Title: Implement GitHub Actions CI Workflow for Task Master
# Status: pending
# Dependencies: None
# Priority: high
# Description: Create a streamlined CI workflow file (ci.yml) that efficiently tests the Task Master codebase using GitHub Actions.
# Details:
Create a GitHub Actions workflow file at `.github/workflows/ci.yml` with the following specifications:
1. Configure the workflow to trigger on:
- Push events to any branch
- Pull request events targeting any branch
2. Core workflow configuration:
- Use Ubuntu latest as the primary testing environment
- Use Node.js 20.x (LTS) for consistency with the project
- Focus on single environment for speed and simplicity
3. Configure workflow steps to:
- Checkout the repository using actions/checkout@v4
- Set up Node.js using actions/setup-node@v4 with npm caching
- Install dependencies with 'npm ci'
- Run tests with 'npm run test:coverage'
4. Implement efficient caching:
- Cache node_modules using actions/cache@v4
- Use package-lock.json hash for cache key
- Implement proper cache restoration keys
5. Ensure proper timeouts:
- 2 minutes for dependency installation
- Appropriate timeout for test execution
6. Artifact handling:
- Upload test results and coverage reports
- Use consistent naming for artifacts
- Retain artifacts for 30 days
# Test Strategy:
To verify correct implementation of the GitHub Actions CI workflow:
1. Manual verification:
- Check that the file is correctly placed at `.github/workflows/ci.yml`
- Verify the YAML syntax is valid
- Confirm all required configurations are present
2. Functional testing:
- Push a commit to verify the workflow triggers
- Create a PR to verify the workflow runs on pull requests
- Verify test coverage reports are generated and uploaded
- Confirm caching is working effectively
3. Performance testing:
- Verify cache hits reduce installation time
- Confirm workflow completes within expected timeframe
- Check artifact upload and download speeds
# Subtasks:
## 1. Create Basic GitHub Actions Workflow [pending]
### Dependencies: None
### Description: Set up the foundational GitHub Actions workflow file with proper triggers and Node.js setup
### Details:
1. Create `.github/workflows/ci.yml`
2. Configure workflow name and triggers
3. Set up Ubuntu runner and Node.js 20.x
4. Implement checkout and Node.js setup actions
5. Configure npm caching
6. Test basic workflow functionality
## 2. Implement Test and Coverage Steps [pending]
### Dependencies: 41.1
### Description: Add test execution and coverage reporting to the workflow
### Details:
1. Add dependency installation with proper timeout
2. Configure test execution with coverage
3. Set up test results and coverage artifacts
4. Verify artifact upload functionality
5. Test the complete workflow
## 3. Optimize Workflow Performance [pending]
### Dependencies: 41.1, 41.2
### Description: Implement caching and performance optimizations
### Details:
1. Set up node_modules caching
2. Configure cache key strategy
3. Implement proper timeout values
4. Test caching effectiveness
5. Document performance improvements