Skip to content

Commit b0e222d

Browse files
authored
Merge pull request #1 from JohT/feature/setup-project
Initial Setup
2 parents e17e87e + d36967a commit b0e222d

File tree

1,660 files changed

+544246
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,660 files changed

+544246
-0
lines changed

.gitattributes

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Common settings that generally should always be used with your language specific settings
2+
3+
# Auto detect text files and perform LF normalization
4+
# https://www.davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/
5+
* text=auto
6+
7+
#
8+
# The above will handle all files NOT found below
9+
#
10+
11+
# Documents
12+
*.bibtex text diff=bibtex
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain
23+
*.md text
24+
*.tex text diff=tex
25+
*.adoc text
26+
*.textile text
27+
*.mustache text
28+
*.csv text
29+
*.tab text
30+
*.tsv text
31+
*.txt text
32+
*.sql text
33+
34+
# Graphics
35+
*.png binary
36+
*.jpg binary
37+
*.jpeg binary
38+
*.gif binary
39+
*.tif binary
40+
*.tiff binary
41+
*.ico binary
42+
# SVG treated as an asset (binary) by default.
43+
*.svg text
44+
# If you want to treat it as binary,
45+
# use the following line instead.
46+
# *.svg binary
47+
*.eps binary
48+
49+
# Scripts
50+
*.bash text eol=lf
51+
*.fish text eol=lf
52+
*.sh text eol=lf
53+
# These are explicitly windows files and should use crlf
54+
*.bat text eol=crlf
55+
*.cmd text eol=crlf
56+
*.ps1 text eol=crlf
57+
58+
# Serialisation
59+
*.json text
60+
*.toml text
61+
*.xml text
62+
*.yaml text
63+
*.yml text
64+
65+
# Archives
66+
*.7z binary
67+
*.gz binary
68+
*.tar binary
69+
*.tgz binary
70+
*.zip binary
71+
72+
# Text files where line endings should be preserved
73+
*.patch -text
74+
75+
#
76+
# Exclude files from exporting
77+
#
78+
79+
.gitattributes export-ignore
80+
.gitignore export-ignore
81+
82+
# Java sources
83+
*.java text diff=java
84+
*.gradle text diff=java
85+
*.gradle.kts text diff=java
86+
87+
# These files are text and should be normalized (Convert crlf => lf)
88+
*.css text diff=css
89+
*.df text
90+
*.htm text diff=html
91+
*.html text diff=html
92+
*.js text
93+
*.jsp text
94+
*.jspf text
95+
*.jspx text
96+
*.properties text
97+
*.tld text
98+
*.tag text
99+
*.tagx text
100+
*.xml text
101+
102+
# These generated analysis-results shouldn't be taken into account for language statistics
103+
analysis-results/** linguist-vendored
104+
105+
# These files are binary and should be left untouched
106+
# (binary is a macro for -text -diff)
107+
*.class binary
108+
*.dll binary
109+
*.ear binary
110+
*.jar binary
111+
*.so binary
112+
*.war binary

.github/pull_request_template.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### 🚀 Feature
2+
3+
-
4+
5+
### ⚙️ Optimization
6+
7+
-
8+
9+
### 🛠 Fix
10+
11+
-
12+
13+
### 📖 Documentation
14+
15+
-
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
name: Analyze Code Graph
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
analysis-name:
7+
description: "The name of the project to analyze. E.g. MyProject-1.0.0"
8+
required: true
9+
type: string
10+
artifacts-upload-name:
11+
description: "The name of the artifacts uploaded with 'actions/upload-artifact' containing the content of the 'artifacts' directory for the analysis."
12+
required: false
13+
type: string
14+
default: ''
15+
sources-upload-name:
16+
description: "The name of the sources uploaded with 'actions/upload-artifact' containing the content of the 'source' directory for the analysis."
17+
required: false
18+
type: string
19+
default: ''
20+
analysis-arguments:
21+
description: "The arguments to pass to the analysis script (default='--profile Neo4jv5-low-memory')."
22+
required: false
23+
type: string
24+
default: '--profile Neo4jv5-low-memory'
25+
typescript-scan-heap-memory:
26+
description: "The heap memory in MB to use for the TypeScript scan (default=4096)"
27+
required: false
28+
type: string
29+
default: '4096'
30+
outputs:
31+
uploaded-analysis-results:
32+
description: "The name of the artifact uploaded with 'actions/upload-artifact' containing the analysis results."
33+
value: ${{ jobs.analyze-code-graph.outputs.uploaded-analysis-results-artifact-name }}
34+
35+
jobs:
36+
analyze-code-graph:
37+
runs-on: ubuntu-latest
38+
outputs:
39+
uploaded-analysis-results-artifact-name: ${{ steps.set-analysis-results-artifact-name.outputs.uploaded-analysis-results-artifact-name }}
40+
strategy:
41+
matrix:
42+
include:
43+
- os: ubuntu-latest
44+
java: 17
45+
python: 3.11
46+
miniforge: 24.9.0-0
47+
steps:
48+
- name: Assure that either artifacts-upload-name or sources-upload-name is set
49+
if: inputs.artifacts-upload-name == '' && inputs.sources-upload-name == ''
50+
run: echo "Please specify either the input parameter 'artifacts-upload-name' or 'sources-upload-name'."; exit 1
51+
- name: Checkout code-graph-analysis-pipeline
52+
uses: actions/checkout@v4
53+
with:
54+
repository: JohT/code-graph-analysis-pipeline
55+
ref: 41f3e22b5bd65351474dd23effeee91fab849a12
56+
path: code-graph-analysis-pipeline
57+
persist-credentials: false
58+
59+
- name: (Java Setup) Java Development Kit (JDK) ${{ matrix.java }}
60+
uses: actions/setup-java@v4
61+
with:
62+
distribution: "temurin"
63+
java-version: ${{ matrix.java }}
64+
65+
# "Setup Python" can be skipped if jupyter notebook analysis-results aren't needed
66+
- name: (Python Setup) Setup Cache for Conda package manager Miniforge
67+
uses: actions/cache@v4
68+
env:
69+
# Increase this value to reset cache if etc/example-environment.yml has not changed
70+
# Reference: https://github.com/conda-incubator/setup-miniconda#caching
71+
CACHE_NUMBER: 0
72+
with:
73+
path: ~/conda_pkgs_dir
74+
key:
75+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-environments-${{hashFiles('**/environment.yml', '.github/workflows/*.yml') }}
76+
77+
- name: (Python Setup) Use version ${{ matrix.python }} with Conda package manager Miniforge
78+
uses: conda-incubator/setup-miniconda@v3
79+
with:
80+
python-version: ${{ matrix.python }}
81+
miniforge-version: ${{ matrix.miniforge }}
82+
activate-environment: codegraph
83+
environment-file: ./code-graph-analysis-pipeline/jupyter/environment.yml
84+
auto-activate-base: false
85+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
86+
- name: (Python Setup) Conda environment info
87+
shell: bash -el {0}
88+
run: conda info
89+
90+
- name: (Code Analysis Setup) Add code-graph-analysis-pipeline temporarily to .gitignore
91+
shell: bash
92+
run: |
93+
echo "" >> .gitignore
94+
echo "# Code Graph Analysis Pipeline" >> .gitignore
95+
echo "code-graph-analysis-pipeline/" >> .gitignore
96+
97+
- name: (Code Analysis Setup) Setup Cache Analysis Downloads
98+
uses: actions/cache@v4
99+
with:
100+
path: ./code-graph-analysis-pipeline/temp/downloads
101+
key:
102+
${{ runner.os }}-${{ hashFiles('**/*.sh') }}
103+
104+
- name: (Code Analysis Setup) Generate Neo4j Initial Password
105+
id: generate-neo4j-initial-password
106+
shell: bash
107+
run: |
108+
generated_password=$( LC_ALL=C tr -dc '[:graph:]' </dev/urandom | head -c 12; echo )
109+
echo "::add-mask::$generated_password"
110+
echo "neo4j-initial-password=$generated_password" >> "$GITHUB_OUTPUT"
111+
112+
- name: (Code Analysis Setup) Initialize Analysis
113+
shell: bash
114+
working-directory: code-graph-analysis-pipeline
115+
env:
116+
NEO4J_INITIAL_PASSWORD: ${{ steps.generate-neo4j-initial-password.outputs.neo4j-initial-password }}
117+
run: ./init.sh ${{ inputs.analysis-name }}
118+
119+
- name: (Code Analysis Setup) Download sources for analysis
120+
if: inputs.sources-upload-name != ''
121+
uses: actions/download-artifact@v4
122+
with:
123+
name: ${{ inputs.sources-upload-name }}
124+
path: code-graph-analysis-pipeline/temp/${{ inputs.analysis-name }}/source/${{ inputs.analysis-name }}
125+
126+
- name: (Code Analysis Setup) Download artifacts for analysis
127+
if: inputs.artifacts-upload-name != ''
128+
uses: actions/download-artifact@v4
129+
with:
130+
name: ${{ inputs.artifacts-upload-name }}
131+
path: code-graph-analysis-pipeline/temp/${{ inputs.analysis-name }}/artifacts
132+
133+
- name: (Code Analysis) Analyze ${{ inputs.analysis-name }}
134+
working-directory: code-graph-analysis-pipeline/temp/${{ inputs.analysis-name }}
135+
# Shell type can be skipped if jupyter notebook analysis-results (and therefore conda) aren't needed
136+
shell: bash -el {0}
137+
env:
138+
NEO4J_INITIAL_PASSWORD: ${{ steps.generate-neo4j-initial-password.outputs.neo4j-initial-password }}
139+
ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION: "true"
140+
IMPORT_GIT_LOG_DATA_IF_SOURCE_IS_PRESENT: "" # Options: "none", "aggregated", "full". default = "plugin" or ""
141+
run: |
142+
TYPESCRIPT_SCAN_HEAP_MEMORY=${{ inputs.typescript-scan-heap-memory }} ./../../scripts/analysis/analyze.sh ${{ inputs.analysis-arguments }}
143+
144+
- name: Assemble ENVIRONMENT_INFO
145+
run: echo "ENVIRONMENT_INFO=-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}" >> $GITHUB_ENV
146+
147+
- name: Set artifact name for uploaded analysis results
148+
id: set-analysis-results-artifact-name
149+
run: echo "uploaded-analysis-results-artifact-name=code-analysis-results-java-${{ env.ENVIRONMENT_INFO }}" >> $GITHUB_OUTPUT
150+
151+
# Upload logs and unfinished analysis-results in case of an error for troubleshooting
152+
- name: (Code Analysis Results) Archive failed run with logs and unfinished analysis-results
153+
if: failure()
154+
uses: actions/upload-artifact@v4
155+
with:
156+
name: java-code-analysis-logs-java-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}
157+
path: |
158+
./code-graph-analysis-pipeline/temp/**/runtime/*
159+
./code-graph-analysis-pipeline/temp/**/reports/*
160+
retention-days: 5
161+
162+
# Upload successful analysis-results in case they are needed for troubleshooting
163+
- name: (Code Analysis Results) Archive successful analysis-results
164+
if: success()
165+
uses: actions/upload-artifact@v4
166+
with:
167+
name: ${{ steps.set-analysis-results-artifact-name.outputs.uploaded-analysis-results-artifact-name }}
168+
path: ./code-graph-analysis-pipeline/temp/**/reports/*
169+
if-no-files-found: error
170+
retention-days: 5
171+
172+
# Upload Database Export
173+
# Only possible after an export with "./../../scripts/analysis/analyze.sh --report DatabaseCsvExport"
174+
# Won't be done here because of performance and security concerns
175+
#- name: Archive exported database
176+
# uses: actions/upload-artifact@v3
177+
# with:
178+
# name: typescript-code-analysis-database-export-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}
179+
# path: ./code-graph-analysis-pipeline/temp/**/import
180+
# if-no-files-found: error
181+
# retention-days: 5
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Check links in documentation
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
# Only watch root level Markdown documentation file changes
8+
paths:
9+
- 'README.md'
10+
- '.github/workflows/check-links-in-documentation.yml' # also run when this file was changed
11+
schedule:
12+
- cron: "15 6 1 * *" # On the first day of each month at 6:15 o'clock
13+
14+
jobs:
15+
analysis-results:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout GIT Repository
19+
uses: actions/checkout@v4
20+
21+
- name: Setup node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version-file: '.nvmrc'
25+
26+
- name: Skip on update of AxonFramework by bot (Renovate)
27+
if: |
28+
github.event_name == 'pull_request' &&
29+
startsWith(github.event.pull_request.title, 'Update dependency AxonFramework') &&
30+
github.event.pull_request.user.type == 'Bot'
31+
run: |
32+
echo "Skipping link check on AxonFramework updates since the updated links to the analysis-results will only be active "
33+
echo "skip_link_check=true" >> $GITHUB_ENV
34+
35+
- name: Check links in top level documentation Markdown files
36+
if: ${{ ! env.skip_link_check}}
37+
run: npx --yes markdown-link-check@3.13.6 --verbose --alive=200,202,206 --retry README.md
38+
# Temporarily, everything is done using command line options rather than with the config file, which doesn't seem to work.
39+
# Maybe related to https://github.com/tcort/markdown-link-check/issues/379 ?
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Check Renovate Configuration
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
# Only watch root level Renovate configuration changes
8+
paths:
9+
- 'renovate.json*'
10+
11+
jobs:
12+
analysis-results:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout GIT Repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version-file: '.nvmrc'
22+
23+
- name: Run renovate-config-validator
24+
run: npx --yes --package renovate@39.91.2 -- renovate-config-validator

0 commit comments

Comments
 (0)