|
| 1 | +# Code Graph Analysis Pipeline - Integration guide |
| 2 | + |
| 3 | +This document describes the steps to get started as quickly as possible. |
| 4 | +:point_right: For more details on what else you can do see [README](./README.md). |
| 5 | +:point_right: For more details on how to analyze your code locally see [GETTING_STARTED](./GETTING_STARTED.md). |
| 6 | + |
| 7 | +## :rocket: How to use it |
| 8 | + |
| 9 | +This repository provides a reusable GitHub Actions Workflow to analyze code. The workflow is defined in [public-analyze-code-graph.yml](./.github/workflows/public-analyze-code-graph.yml). |
| 10 | + |
| 11 | +The main idea is to have three workflow jobs: |
| 12 | + |
| 13 | +1. **Collect source code and build artifacts**: Gather the source code and any build artifacts. |
| 14 | +2. **Run the analysis**: Use the reusable workflow to analyze the collected code and artifacts. |
| 15 | +3. **Download the reports**: Retrieve the analysis reports generated by the workflow. |
| 16 | + |
| 17 | +The workflow requires the names of the uploaded artifacts (source code and build artifacts) and provides the names of the artifact containing the analysis results for download. |
| 18 | + |
| 19 | +You can find examples in: |
| 20 | + |
| 21 | +- [internal-java-code-analysis.yml](./.github/workflows/internal-java-code-analysis.yml) |
| 22 | +- [internal-typescript-code-analysis.yml](./.github/workflows/internal-typescript-code-analysis.yml) |
| 23 | + |
| 24 | +:warning: Note: Workflows with names starting with `internal-` are private and should not be used outside this repository. They may change at any time without notice. |
| 25 | + |
| 26 | +## :gear: Parameters |
| 27 | + |
| 28 | +The workflow parameters are as follows: |
| 29 | + |
| 30 | +- **analysis-name**: The name of the project to analyze. Example: MyProject-1.0.0. This parameter is required and should be a string. |
| 31 | +- **artifacts-upload-name**: The name of the artifacts uploaded with [actions/upload-artifact](https://github.com/actions/upload-artifact/tree/65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08) containing the content of the 'artifacts' directory for the analysis. This is used to analyze Java JARs, WARs, EARs, etc. This parameter is optional and defaults to an empty string. |
| 32 | +- **sources-upload-name**: The name of the sources uploaded with [actions/upload-artifact](https://github.com/actions/upload-artifact/tree/65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08) containing the content of the 'source' directory for the analysis. It also supports sub-folders for multiple source code bases. This parameter is optional and defaults to an empty string. |
| 33 | +- **ref**: The branch, tag, or SHA of the code-graph-analysis-pipeline to checkout. This parameter is optional and defaults to "main". |
| 34 | +- **analysis-arguments**: The arguments to pass to the analysis script. This parameter is optional and defaults to '--profile Neo4jv5-low-memory'. |
| 35 | +- **typescript-scan-heap-memory**: The heap memory size in MB to use for the TypeScript code scans. This value is only used for the TypeScript code scans and is ignored for other scans. This parameter is optional and defaults to '4096'. |
| 36 | + |
| 37 | +The workflow also provides an output parameter: |
| 38 | + |
| 39 | +- **uploaded-analysis-results**: The name of the artifact uploaded with 'actions/upload-artifact' containing all analysis |
0 commit comments