CI/CD & GitHub Actions
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The CI/CD infrastructure for the dxkb project focuses on ensuring code quality, technical accuracy, and reliable deployments through automated testing and linting. The project utilizes a modern JavaScript/TypeScript stack, leveraging pnpm for package management and vitest for its comprehensive testing suite. These automated processes validate core utilities, workspace service methods, and complex form transformation logic across the application.
Automated pipelines are responsible for executing unit and integration tests defined throughout the codebase, ensuring that utility functions like path sanitization and job formatting remain robust. This infrastructure supports a high-confidence development workflow by catching regressions in critical areas such as SARS-CoV-2 analysis transformations and workspace CRUD operations before they reach production.
Sources: package.json:1-118, src/lib/tests/utils.test.ts
Scripts and Automation
The project defines a specific set of scripts within its configuration to facilitate local development and automated CI environments. These scripts primarily focus on building the Next.js application, linting the source code for style and best practices, and executing various testing modes.
| Script | Command | Purpose |
|---|---|---|
dev | next dev --turbopack -p 3019 | Starts the development server with Turbopack. |
build | next build | Compiles the application for production. |
lint | eslint . | Runs static code analysis to find and fix problems. |
test | vitest run | Executes the test suite once (ideal for CI pipelines). |
test:watch | vitest | Runs tests in interactive watch mode for development. |
test:coverage | vitest run --coverage | Executes tests and generates code coverage reports. |
Sources: package.json:7-15
Testing Infrastructure
The project utilizes vitest as its primary testing framework, complemented by @testing-library/react and jsdom for environment simulation. The CI pipeline is structured to validate three main layers of the application: core utilities, service methods, and form logic.
Core Utility Validation
CI processes ensure that fundamental helpers, such as Tailwind CSS class merging (cn), path sanitization, and workspace segment encoding, function correctly across different edge cases.
The diagram above shows the typical flow of the CI test execution process.
Sources: src/lib/tests/utils.test.ts:1-100, package.json:49-76
Service and CRUD Logic
A significant portion of the CI suite is dedicated to testing the WorkspaceCrudMethods. These tests mock the WorkspaceApiClient to verify that requests to "Workspace.create", "Workspace.delete", and "Workspace.copy" are dispatched with the correct parameters and payloads.
Form Transformation Tests
The CI pipeline validates the transformation of user input into backend-compatible job parameters. Specifically, tests for the SARS-CoV-2 genome analysis ensure that:
taxonomy_idis correctly mapped.paired_end_libsandsingle_end_libsare structured accurately.- Output filenames are sanitized by removing special characters like parentheses and colons.
Sources: src/lib/services/workspace/methods/tests/crud.test.ts:1-150, src/lib/forms/(viral-tools)/sars-cov2-genome-analysis/tests/sars-cov2-genome-analysis-form-utils.test.ts:50-120
Dependency Management
The CI environment relies on pnpm (version 10.32.1) to manage a complex tree of dependencies, including Next.js 16, React 19, and various TanStack libraries.
Key Development Dependencies
The following tools are essential to the CI/CD pipeline's success:
- ESLint: Enforces coding standards during the
lintphase. - Vitest: The engine for all automated tests.
- TypeScript: Provides static type checking to catch errors before runtime.
- Prettier: Often used in conjunction with linting to ensure consistent formatting.
Sources: package.json:78-115, package.json:117
Conclusion
The CI/CD and GitHub Actions framework for dxkb is built on a foundation of rigorous automated testing and standardized scripts. By integrating vitest for single-run CI tests and eslint for static analysis, the project maintains high standards for code quality and functional reliability. This infrastructure ensures that critical bioinformatics workflows and workspace management features are consistently validated, facilitating a stable and scalable development lifecycle.