1- name : Typescript Code Structure Graph Analysis
1+ name : react-router Typescript Code Structure Graph Analysis
22
33on :
44 push :
1515 - ' .gitignore'
1616 - ' .gitattributes'
1717 - ' renovate.json'
18- - ' changelogTemplate.mustache'
1918 - ' **.code-workspace'
2019 - ' .github/workflows/java-code-analysis.yml'
2120 - ' .github/workflows/*documentation.yml'
3332 - ' .gitignore'
3433 - ' .gitattributes'
3534 - ' renovate.json'
36- - ' changelogTemplate.mustache'
3735 - ' **.code-workspace'
3836 - ' .github/workflows/java-code-analysis.yml'
3937 - ' .github/workflows/*documentation.yml'
4038
41- # Requires the secret NEO4J_INITIAL_PASSWORD to be configured
4239jobs :
4340 analysis-results :
44- # This workflow is disabled for now and will be enabled as soon as the everything is set up correctly
45- if : false
4641 runs-on : ubuntu-latest
4742 strategy :
4843 matrix :
@@ -65,84 +60,57 @@ jobs:
6560 with :
6661 token : ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
6762
68- - name : Setup Java JDK ${{ matrix.java }}
69- uses : actions/setup-java@v4
70- with :
71- distribution : ' adopt'
72- java-version : ${{ matrix.java }}
73-
74- - name : Setup Cache for Conda package manager Miniforge
75- uses : actions/cache@v4
76- env :
77- # Increase this value to reset cache if etc/example-environment.yml has not changed
78- # Reference: https://github.com/conda-incubator/setup-miniconda#caching
79- CACHE_NUMBER : 0
80- with :
81- path : ~/conda_pkgs_dir
82- key :
83- ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-environments-${{hashFiles('**/environment.yml', '.github/workflows/*.yml') }}
63+ - name : (Code Analysis Setup) Set ANALYSIS_NAME
64+ run : echo "ANALYSIS_NAME=${{ env.PROJECT_NAME }}-${{ env.REACT_ROUTER_VERSION }}" >> $GITHUB_ENV
8465
85- # "Setup Python" can be skipped if jupyter notebook analysis-results aren't needed
86- - name : Setup Python ${{ matrix.python }} with Conda package manager Miniforge
87- uses : conda-incubator/setup-miniconda@v3
66+ - name : (Code Analysis Setup) Generate Neo4j Initial Password
67+ id : generate_neo4j_initial_password
68+ shell : bash
69+ run : |
70+ generated_password=$( LC_ALL=C tr -dc '[:graph:]' </dev/urandom | head -c 12; echo )
71+ echo "::add-mask::$generated_password"
72+ echo "neo4j_initial_password=$generated_password" >> "$GITHUB_OUTPUT"
73+
74+ - name : Setup Code Analysis
75+ uses : ./.github/actions/setup-code-analysis
8876 with :
77+ java-version : ${{ matrix.java }}
8978 python-version : ${{ matrix.python }}
9079 miniforge-version : ${{ matrix.miniforge }}
91- activate-environment : codegraph
92- environment-file : ./jupyter/environment.yml
93- auto-activate-base : false
94- use-only-tar-bz2 : true # IMPORTANT: This needs to be set for caching to work properly!
95-
96- - name : Conda environment info
97- shell : bash -el {0}
98- run : conda info
99-
100- - name : Conda environment list updates
101- shell : bash -el {0}
102- run : conda update --all --dry-run | grep -Fe '-->'
103-
104- - name : Setup temp directory if missing
105- run : mkdir -p ./temp
106-
107- - name : Setup Cache for "temp/downloads" folder
108- uses : actions/cache@v4
109- with :
110- path : ./temp/downloads
111- key :
112- ${{ runner.os }}-${{ hashFiles('**/*.sh') }}
113-
114- - name : Download ${{ env.PROJECT_NAME }}-${{ env.REACT_ROUTER_VERSION }}
115- working-directory : temp
80+ analysis-name : ${{ env.ANALYSIS_NAME }}
81+ neo4j-password : ${{ steps.generate_neo4j_initial_password.outputs.neo4j_initial_password }}
82+
83+ - name : (Code Analysis Setup) Download ${{ env.ANALYSIS_NAME }}
84+ working-directory : code-graph-analysis-pipeline/temp/${{ env.ANALYSIS_NAME }}
11685 run : |
117- mkdir -p ${{ env.PROJECT_NAME }}-${{ env.REACT_ROUTER_VERSION }}
118- cd ${{ env.PROJECT_NAME }}-${{ env.REACT_ROUTER_VERSION }}
119- echo "Working directory: $( pwd -P )"
12086 ./../../scripts/downloader/downloadReactRouter.sh ${{ env.REACT_ROUTER_VERSION }}
12187
122- - name : Setup pnpm for react-router
88+ - name : (Code Analysis Setup) Setup pnpm for react-router
12389 uses : pnpm/action-setup@v4.0.0
12490 with :
125- package_json_file : temp/${{env.PROJECT_NAME}}-${{env.REACT_ROUTER_VERSION}} /source/${{env.PROJECT_NAME}}-${{env.REACT_ROUTER_VERSION }}/package.json
91+ package_json_file : code-graph-analysis-pipeline/ temp/${{ env.ANALYSIS_NAME }} /source/${{ env.ANALYSIS_NAME }}/package.json
12692
127- - name : Install dependencies with pnpm
128- working-directory : temp/${{ env.PROJECT_NAME }}-${{ env.REACT_ROUTER_VERSION }} /source/${{ env.PROJECT_NAME }}-${{ env.REACT_ROUTER_VERSION }}
93+ - name : (Code Analysis Setup) Install dependencies with pnpm
94+ working-directory : code-graph-analysis-pipeline/ temp/${{ env.ANALYSIS_NAME }}/source/${{ env.ANALYSIS_NAME }}
12995 run : |
13096 pnpm install --frozen-lockfile --strict-peer-dependencies
13197
132- - name : Analyze ${{ env.PROJECT_NAME }}-${{ env.REACT_ROUTER_VERSION }}
133- working-directory : temp/${{ env.PROJECT_NAME }}-${{ env.REACT_ROUTER_VERSION }}
98+ - name : Analyze ${{ env.ANALYSIS_NAME }}
99+ working-directory : code-graph-analysis-pipeline/ temp/${{ env.ANALYSIS_NAME }}
134100 # Shell type can be skipped if jupyter notebook analysis-results (and therefore conda) aren't needed
135101 shell : bash -el {0}
136102 env :
137- NEO4J_INITIAL_PASSWORD : ${{ secrets.NEO4J_INITIAL_PASSWORD }}
103+ NEO4J_INITIAL_PASSWORD : ${{ steps.generate_neo4j_initial_password.outputs.neo4j_initial_password }}
138104 ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION : " true"
139105 IMPORT_GIT_LOG_DATA_IF_SOURCE_IS_PRESENT : " " # Options: "none", "aggregated", "full". default = "plugin" or ""
140106 run : |
141- ./../../scripts/analysis/analyze.sh
107+ ./../../scripts/analysis/analyze.sh --profile Neo4jv5-low-memory
142108
143- - name : Move analysis-results from the temp to the analysis-results directory preserving their surrounding directory
144- working-directory : temp
145- run : ./../scripts/copyReportsIntoResults.sh
109+ - name : (Code Analysis) Collect analysis results
110+ working-directory : code-graph-analysis-pipeline/temp/${{ env.ANALYSIS_NAME }}
111+ run : |
112+ mkdir -p ./../../../analysis-results/${{ env.ANALYSIS_NAME }}
113+ cp -Rp reports ./../../../analysis-results/${{ env.ANALYSIS_NAME }}
146114
147115 # Upload logs and unfinished analysis-results in case of an error for troubleshooting
148116 - name : Archive failed run with logs and unfinished analysis-results
@@ -151,8 +119,8 @@ jobs:
151119 with :
152120 name : typescript-code-analysis-logs-java-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}
153121 path : |
154- ./temp/**/runtime/*
155- ./temp/**/analysis- results/*
122+ ./code-graph-analysis-pipeline/ temp/**/runtime/*
123+ ./code-graph-analysis-pipeline/ temp/**/results/*
156124 retention-days : 5
157125
158126 # Upload successful analysis-results in case they are needed for troubleshooting
@@ -161,7 +129,7 @@ jobs:
161129 uses : actions/upload-artifact@v4
162130 with :
163131 name : typescript-code-analysis-analysis-results-java-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}
164- path : ./temp/**/ analysis-results/*
132+ path : ./analysis-results/${{ env.ANALYSIS_NAME }} /*
165133 if-no-files-found : error
166134 retention-days : 5
167135
@@ -172,14 +140,14 @@ jobs:
172140 # uses: actions/upload-artifact@v3
173141 # with:
174142 # name: typescript-code-analysis-database-export-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}
175- # path: ./temp/**/import
143+ # path: ./code-graph-analysis-pipeline/ temp/**/import
176144 # if-no-files-found: error
177145 # retention-days: 5
178146
179147 # Commit and push the native image agent analysis-results
180148 - name : Display environment variable "github.event_name"
181149 run : echo "github.event_name=${{ github.event_name }}"
182- - name : Commit "analysis-results" directory containing the analysis-results
150+ - name : Commit changes in the " analysis-results" directory
183151 # Only run when a pull request gets merged or a commit is pushed to the main branch
184152 # git add parameters need to match paths-ignore parameters above
185153 # Git pull before add/commit/push to reduce race conditions on parallel builds
0 commit comments