Code Review - Legacy
The Code Review - Legacy workflow is used to perform code quality checks for Node.js projects.
caution
This workflow has been deprecated as part of the migration to a monorepo architecture.
How It Works
The workflow performs the following steps:
- Checks out the code from the repository.
- Sets up
Node.js
and enablesCorepack
for managing package managers. - Installs dependencies and builds the project.
- Runs linting and API linting checks.
- Generates API definitions.
- Executes unit tests and uploads coverage reports to Codecov.
info
Ensure that yarn
is properly configured in your project with the necessary
scripts for linting, testing, and generating API definitions. The package.json
file must define the following npm tasks:
lint
: To run code linting.lint-api
: To validate API specifications.generate
: To generate API models or definitions.test:coverage
: To execute tests and generate coverage reports.
These scripts are required for the workflow to function as expected.
Usage
To use the Code Review workflow, invoke it as a reusable workflow in your repository. Below is an example configuration:
name: Code Review
on:
pull_request:
jobs:
code_review:
uses: pagopa/dx/.github/workflows/legacy_code_review.yaml@main
name: Code Review
secrets: inherit
Notes
- Ensure that your project includes scripts for linting, testing, and generating API definitions.
- To enable Codecov integration, set the
CODECOV_TOKEN
secret in your repository.