This document summarizes the complete CI/CD pipeline and testing infrastructure for the llms.txt Generator GitHub Action.
The project now has a comprehensive pipeline for testing, building, bundling, and releasing the action to GitHub.
Triggers: Push to main/develop, Pull requests
Jobs:
-
Test: Runs unit tests
- Checkout code
- Setup Node.js 20
- Install dependencies
- Run unit tests
- Build TypeScript
-
Integration Test: Tests complete workflow
- Creates test fixtures dynamically
- Runs action against fixtures
- Validates generated files
- Checks file structure and content
- Uploads test artifacts
-
Bundle: Creates distribution bundle
- Builds and bundles action
- Checks bundle size
- Uploads bundle artifact
-
Lint: Code quality checks
- TypeScript compilation check
- No syntax errors
Triggers: Push of version tags (v*)
Process:
- Checkout code with full history
- Setup Node.js 20
- Install dependencies
- Run full test suite
- Build and bundle action
- Create release archive
- Generate changelog from git commits
- Create GitHub release with assets
- Update major version tag (e.g., v1 → v1.2.0)
Outputs:
- GitHub release with changelog
- Release archive (.tar.gz)
- Updated major version tag
Triggers: Manual dispatch, Weekly schedule
Scenarios:
- Basic Usage: Simple markdown files
- Complex Structure: Multiple directories and sections
- Special Characters: Filenames with special chars
- Exclude Patterns: File filtering
- Empty Files: Edge case handling
- Different Extensions: .md, .mdx, .markdown
Each scenario:
- Creates realistic test fixtures
- Runs the action
- Validates output
- Checks for expected content
Updates:
- npm dependencies (weekly)
- GitHub Actions versions (weekly)
Configuration:
- Auto-labels PRs
- Conventional commit messages
- Limits open PRs
Location: src*.test.ts
Framework: Vitest
Coverage:
- File scanning
- Markdown parsing
- Content generation
- URL formatting
- Section categorization
Run: npm test
Location: tests/integration/
Script: test-runner.sh
Tests:
- Basic functionality
- Multiple sections
- Exclude patterns
- Error handling
Run: npm run test:integration
Integration tests create temporary fixtures:
- Realistic markdown files
- Various directory structures
- Edge cases (empty files, special chars)
- Files to be excluded
- README.md: Project overview and quick start
- QUICKSTART.md: 5-minute setup guide
- src/README.md: Complete action documentation
- CONTRIBUTING.md: Contribution guidelines
- TESTING.md: Comprehensive testing guide
- PUBLISHING.md: Release process
- RELEASE_CHECKLIST.md: Pre-release checklist
- PIPELINE_SETUP.md: This document
- Bug Report:
.github/ISSUE_TEMPLATE/bug_report.md - Feature Request:
.github/ISSUE_TEMPLATE/feature_request.md - Pull Request:
.github/PULL_REQUEST_TEMPLATE.md
-
Update version:
cd src npm version patch # or minor, major
-
Build and bundle:
npm run package
-
Commit bundle:
git add dist/ git commit -m "chore: update bundle for release" -
Push with tags:
git push origin main --tags
-
Automated steps:
- CI runs all tests
- Release workflow triggers
- GitHub release created
- Changelog generated
- Major version tag updated
Users can reference:
- Specific:
@v1.0.0(pinned) - Major:
@v1(latest v1.x.x) - Branch:
@main(not recommended)
{
"build": "tsc",
"bundle": "ncc build srcmain.ts -o dist",
"package": "npm run build && npm run bundle",
"test": "vitest --run",
"test:integration": "bash tests/integration/test-runner.sh",
"test:all": "npm test && npm run test:integration"
}.
├── .github/
│ ├── actions/
│ │ └── llms-txt-generator/
│ │ ├── src # TypeScript source
│ │ │ ├── main.ts
│ │ │ ├── file-scanner.ts
│ │ │ ├── parser.ts
│ │ │ ├── generator.ts
│ │ │ ├── types.ts
│ │ │ └── *.test.ts # Unit tests
│ │ ├── tests/
│ │ │ └── integration/ # Integration tests
│ │ ├── dist/ # Bundled output
│ │ ├── action.yml # Action metadata
│ │ ├── package.json
│ │ └── README.md
│ ├── workflows/
│ │ ├── ci.yml # Main CI pipeline
│ │ ├── release.yml # Release automation
│ │ └── test-scenarios.yml # Comprehensive tests
│ ├── dependabot.yml # Dependency updates
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ └── PULL_REQUEST_TEMPLATE.md
├── sample/ # Example data (not used in CI)
├── CONTRIBUTING.md
├── PUBLISHING.md
├── QUICKSTART.md
├── TESTING.md
├── RELEASE_CHECKLIST.md
├── PIPELINE_SETUP.md
└── README.md
┌─────────────────┐
│ Push to main │
│ or PR created │
└────────┬────────┘
│
▼
┌─────────────────┐
│ CI Workflow │
├─────────────────┤
│ • Unit tests │
│ • Integration │
│ • Build │
│ • Bundle │
│ • Lint │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Tests pass? │
└────┬───────┬────┘
│ │
Yes No
│ │
│ └──► ❌ Fail PR
│
▼
┌─────────────────┐
│ Merge to main │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Create tag │
│ (npm version) │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Release Workflow│
├─────────────────┤
│ • Run tests │
│ • Build/bundle │
│ • Create release│
│ • Update v1 tag │
└────────┬────────┘
│
▼
┌─────────────────┐
│ ✅ Published! │
└─────────────────┘
- ✅ All unit tests pass
- ✅ All integration tests pass
- ✅ TypeScript compiles
- ✅ Bundle builds successfully
- ✅ Code review approved
- ✅ All tests pass
- ✅ Documentation updated
- ✅ CHANGELOG updated
- ✅ Version bumped
- ✅ Bundle committed
- Check GitHub Actions runs
- Monitor for issues
- Review error reports
- Respond to user feedback
- Test pass rate
- Bundle size
- Build time
- Action usage
- Issue response time
- Weekly: Review Dependabot PRs
- Monthly: Review and update documentation
- Quarterly: Security audit
- As needed: Bug fixes and features
Dependabot automatically:
- Creates PRs for updates
- Runs tests on updates
- Labels appropriately
Review and merge when tests pass.
- Check workflow logs
- Run tests locally
- Verify Node.js version matches
- Check for environment differences
- Verify tag format (v*)
- Check permissions
- Review release workflow logs
- Ensure bundle is committed
- Check test fixtures
- Verify action inputs
- Review generated output
- Check for path issues
- Read CONTRIBUTING.md
- Setup development environment
- Run tests locally
- Make changes
- Submit PR
- Review RELEASE_CHECKLIST.md
- Follow release process
- Monitor after release
- Respond to issues
- Read QUICKSTART.md
- Add workflow to repository
- Customize as needed
- Report issues if found
Pipeline Status: ✅ Fully Configured
Last Updated: [Date]
Maintained By: [Your Team]