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
4139# Requires the secret NEO4J_INITIAL_PASSWORD to be configured
4240jobs :
4341 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
4642 runs-on : ubuntu-latest
4743 strategy :
4844 matrix :
@@ -65,84 +61,49 @@ jobs:
6561 with :
6662 token : ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
6763
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') }}
64+ - name : (Code Analysis Setup) Set ANALYSIS_NAME
65+ run : echo "ANALYSIS_NAME=${{ env.PROJECT_NAME }}-${{ env.REACT_ROUTER_VERSION }}" >> $GITHUB_ENV
8466
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
67+ - name : Setup Code Analysis
68+ uses : ./.github/actions/setup-code-analysis
8869 with :
70+ java-version : ${{ matrix.java }}
8971 python-version : ${{ matrix.python }}
9072 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
73+ analysis-name : ${{ env.ANALYSIS_NAME }}
74+ neo4j-password : ${{ secrets.NEO4J_INITIAL_PASSWORD }}
75+
76+ - name : (Code Analysis Setup) Download ${{ env.ANALYSIS_NAME }}
77+ working-directory : code-graph-analysis-pipeline/temp/${{ env.ANALYSIS_NAME }}
11678 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 )"
12079 ./../../scripts/downloader/downloadReactRouter.sh ${{ env.REACT_ROUTER_VERSION }}
12180
122- - name : Setup pnpm for react-router
81+ - name : (Code Analysis Setup) Setup pnpm for react-router
12382 uses : pnpm/action-setup@v4.0.0
12483 with :
125- package_json_file : temp/${{env.PROJECT_NAME}}-${{env.REACT_ROUTER_VERSION}} /source/${{env.PROJECT_NAME}}-${{env.REACT_ROUTER_VERSION }}/package.json
84+ package_json_file : code-graph-analysis-pipeline/ temp/${{ env.ANALYSIS_NAME }} /source/${{ env.ANALYSIS_NAME }}/package.json
12685
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 }}
86+ - name : (Code Analysis Setup) Install dependencies with pnpm
87+ working-directory : code-graph-analysis-pipeline/ temp/${{ env.ANALYSIS_NAME }}/source/${{ env.ANALYSIS_NAME }}
12988 run : |
13089 pnpm install --frozen-lockfile --strict-peer-dependencies
13190
132- - name : Analyze ${{ env.PROJECT_NAME }}-${{ env.REACT_ROUTER_VERSION }}
133- working-directory : temp/${{ env.PROJECT_NAME }}-${{ env.REACT_ROUTER_VERSION }}
91+ - name : Analyze ${{ env.ANALYSIS_NAME }}
92+ working-directory : temp/${{ env.ANALYSIS_NAME }}
13493 # Shell type can be skipped if jupyter notebook analysis-results (and therefore conda) aren't needed
13594 shell : bash -el {0}
13695 env :
13796 NEO4J_INITIAL_PASSWORD : ${{ secrets.NEO4J_INITIAL_PASSWORD }}
13897 ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION : " true"
13998 IMPORT_GIT_LOG_DATA_IF_SOURCE_IS_PRESENT : " " # Options: "none", "aggregated", "full". default = "plugin" or ""
14099 run : |
141- ./../../scripts/analysis/analyze.sh
100+ ./../../scripts/analysis/analyze.sh --profile Neo4jv5-low-memory
142101
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
102+ - name : (Code Analysis) Collect analysis results
103+ working-directory : code-graph-analysis-pipeline/temp/${{ env.ANALYSIS_NAME }}
104+ run : |
105+ mkdir -p ./../../../analysis-results/${{ env.ANALYSIS_NAME }}
106+ cp -Rp reports ./../../../analysis-results/${{ env.ANALYSIS_NAME }}
146107
147108 # Upload logs and unfinished analysis-results in case of an error for troubleshooting
148109 - name : Archive failed run with logs and unfinished analysis-results
@@ -151,8 +112,8 @@ jobs:
151112 with :
152113 name : typescript-code-analysis-logs-java-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}
153114 path : |
154- ./temp/**/runtime/*
155- ./temp/**/analysis- results/*
115+ ./code-graph-analysis-pipeline/ temp/**/runtime/*
116+ ./code-graph-analysis-pipeline/ temp/**/results/*
156117 retention-days : 5
157118
158119 # Upload successful analysis-results in case they are needed for troubleshooting
@@ -161,7 +122,7 @@ jobs:
161122 uses : actions/upload-artifact@v4
162123 with :
163124 name : typescript-code-analysis-analysis-results-java-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}
164- path : ./temp/**/ analysis-results/*
125+ path : ./analysis-results/${{ env.ANALYSIS_NAME }} /*
165126 if-no-files-found : error
166127 retention-days : 5
167128
@@ -172,14 +133,14 @@ jobs:
172133 # uses: actions/upload-artifact@v3
173134 # with:
174135 # name: typescript-code-analysis-database-export-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}
175- # path: ./temp/**/import
136+ # path: ./code-graph-analysis-pipeline/ temp/**/import
176137 # if-no-files-found: error
177138 # retention-days: 5
178139
179140 # Commit and push the native image agent analysis-results
180141 - name : Display environment variable "github.event_name"
181142 run : echo "github.event_name=${{ github.event_name }}"
182- - name : Commit "analysis-results" directory containing the analysis-results
143+ - name : Commit changes in the " analysis-results" directory
183144 # Only run when a pull request gets merged or a commit is pushed to the main branch
184145 # git add parameters need to match paths-ignore parameters above
185146 # Git pull before add/commit/push to reduce race conditions on parallel builds
0 commit comments