feat:setup project workflow and template #27
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR sets up a Continuous Integration (CI) workflow for the project using GitHub Actions. The workflow is triggered on both push and pull_request events for the main branch. It includes the following steps to automate code quality checks and tests:
Install Dependencies:
The workflow installs project dependencies using npm ci, ensuring a clean and fast installation based on the package-lock.json file.
Node Modules Caching:
The node_modules folder is cached using the SHA of the current commit. This speeds up subsequent jobs by avoiding redundant dependency installations across linting, formatting, TypeScript checks, and unit tests.
Linting (ESLint):
Ensures code quality by running npm run lint:check. Any linting issues in the code will be flagged during this step.
Formatting (Prettier):
Verifies that the code adheres to the project's formatting guidelines using npm run prettier:check. Any formatting discrepancies will be reported.
TypeScript Checks:
Runs TypeScript checks (npm run ts:check) to catch type errors in the project, ensuring type safety.
Unit Tests:
Executes unit tests using npm run test:unit to validate the functionality of the project and make sure the code behaves as expected.
Benefits:
Improved CI Pipeline Performance: With caching of node_modules, the workflow is faster and more efficient, reducing build times by reusing cached dependencies when possible.
Automated Quality Assurance: Linting, formatting, type checking, and testing are automated to maintain high code quality and reliability.
Consistency Across Jobs: The setup ensures that all jobs (linting, formatting, type checking, and testing) run on the same set of dependencies, minimizing the risk of discrepancies.**