1+ name : Typescript Code Upload Example for Graph Analysis
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ # Ignore changes in documentation, general configuration and reports for push events
8+ paths-ignore :
9+ - ' **/*.md'
10+ - ' **/*.txt'
11+ - ' !requirements.txt'
12+ - ' **/*.css'
13+ - ' **/*.html'
14+ - ' **/*.js'
15+ - ' .gitignore'
16+ - ' .gitattributes'
17+ - ' renovate.json'
18+ - ' renovate-presets/**'
19+ - ' changelogTemplate.mustache'
20+ - ' **.code-workspace'
21+ - ' .github/workflows/internal-java-code-analysis.yml'
22+ - ' .github/workflows/*documentation.yml'
23+ pull_request :
24+ branches :
25+ - main
26+ # Ignore changes in documentation, general configuration and reports for pull request events
27+ paths-ignore :
28+ - ' **/*.md'
29+ - ' **/*.txt'
30+ - ' !requirements.txt'
31+ - ' **/*.css'
32+ - ' **/*.html'
33+ - ' **/*.js'
34+ - ' .gitignore'
35+ - ' .gitattributes'
36+ - ' renovate.json'
37+ - ' renovate-presets/**'
38+ - ' changelogTemplate.mustache'
39+ - ' **.code-workspace'
40+ - ' .github/workflows/internal-java-code-analysis.yml'
41+ - ' .github/workflows/*documentation.yml'
42+
43+ jobs :
44+
45+ prepare-code-to-analyze :
46+ runs-on : ubuntu-latest
47+ outputs :
48+ analysis-name : ${{ steps.set-analysis-name.outputs.analysis-name }}
49+ sources-upload-name : ${{ steps.set-sources-upload-name.outputs.sources-upload-name }}
50+
51+ env :
52+ PROJECT_NAME : react-router
53+ # Version variable name matches renovate.json configuration entry
54+ REACT_ROUTER_VERSION : 6.30.2
55+
56+ steps :
57+ - name : (Prepare Code to Analyze) Checkout GIT repository
58+ uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
59+
60+
61+ - name : Set Set output variable 'analysis-name'
62+ id : set-analysis-name
63+ run : echo "analysis-name=${{ env.PROJECT_NAME }}-${{ env.REACT_ROUTER_VERSION }}" >> "$GITHUB_OUTPUT"
64+
65+ - name : Setup temp directory if missing
66+ run : mkdir -p ./temp
67+
68+ - name : Setup Cache for "temp/downloads" folder
69+ uses : actions/cache@v4
70+ with :
71+ path : ./temp/downloads
72+ key :
73+ ${{ runner.os }}-${{ hashFiles('**/*.sh') }}
74+
75+ - name : Download ${{ steps.set-analysis-name.outputs.analysis-name }}
76+ working-directory : temp
77+ run : |
78+ mkdir -p ${{ steps.set-analysis-name.outputs.analysis-name }}
79+ cd ${{ steps.set-analysis-name.outputs.analysis-name }}
80+ echo "Working directory: $( pwd -P )"
81+ ./../../scripts/downloader/downloadReactRouter.sh ${{ env.REACT_ROUTER_VERSION }}
82+
83+ - name : (Prepare Code to Analyze) Setup pnpm for react-router
84+ uses : pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
85+ with :
86+ package_json_file : temp/${{ steps.set-analysis-name.outputs.analysis-name }}/source/${{ steps.set-analysis-name.outputs.analysis-name }}/package.json
87+
88+ - name : (Prepare Code to Analyze) Install dependencies with pnpm
89+ working-directory : temp/${{ steps.set-analysis-name.outputs.analysis-name }}/source/${{ steps.set-analysis-name.outputs.analysis-name }}
90+ run : pnpm install --frozen-lockfile --strict-peer-dependencies
91+
92+ - name : Debug folder structure in temp directory
93+ if : runner.debug == '1'
94+ working-directory : temp
95+ run : |
96+ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
97+
98+ - name : (Prepare Code to Analyze) Generate ARTIFACT_UPLOAD_ID
99+ run : echo "ARTIFACT_UPLOAD_ID=$(LC_ALL=C tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 10)" >> $GITHUB_ENV
100+
101+ - name : (Prepare Code to Analyze) Set sources-upload-name
102+ id : set-sources-upload-name
103+ run : echo "sources-upload-name=${{ steps.set-analysis-name.outputs.analysis-name }}-analysis-sources_input-${{ env.ARTIFACT_UPLOAD_ID }}" >> "$GITHUB_OUTPUT"
104+
105+ - name : (Prepare Code to Analyze) Upload code to analyze
106+ if : success()
107+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
108+ with :
109+ name : ${{ steps.set-sources-upload-name.outputs.sources-upload-name }}
110+ path : ./temp/${{ steps.set-analysis-name.outputs.analysis-name }}/source
111+ include-hidden-files : true
112+ if-no-files-found : error
113+ retention-days : 1
114+
115+
116+
117+ explore-code-graph :
118+ needs : [prepare-code-to-analyze]
119+ uses : ./.github/workflows/public-analyze-code-graph.yml
120+ with :
121+ analysis-name : ${{ needs.prepare-code-to-analyze.outputs.analysis-name }}
122+ sources-upload-name : ${{ needs.prepare-code-to-analyze.outputs.sources-upload-name }}
123+ jupyter-pdf : " false"
124+ analysis-arguments : " --explore" # Only setup the Graph, do not generate any reports
0 commit comments