Skip to content

Commit a72caa4

Browse files
committed
Configure project
1 parent 826933d commit a72caa4

10 files changed

+774
-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: 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
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
name: AxonFramework Java Code Structure Graph Analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
# Ignore changes in documentation, general configuration and analysis-results for push events
8+
paths-ignore:
9+
- 'analysis-results/**'
10+
- '**/*.md'
11+
- '**/*.txt'
12+
- '**/*.css'
13+
- '**/*.html'
14+
- '**/*.js'
15+
- '.gitignore'
16+
- '.gitattributes'
17+
- 'renovate.json'
18+
- '**.code-workspace'
19+
- '.github/workflows/typescript-code-analysis.yml'
20+
- '.github/workflows/*documentation.yml'
21+
pull_request:
22+
branches:
23+
- main
24+
# Ignore changes in documentation, general configuration and analysis-results for pull request events
25+
paths-ignore:
26+
- 'analysis-results/**'
27+
- '**/*.md'
28+
- '**/*.txt'
29+
- '**/*.css'
30+
- '**/*.html'
31+
- '**/*.js'
32+
- '.gitignore'
33+
- '.gitattributes'
34+
- 'renovate.json'
35+
- '**.code-workspace'
36+
- '.github/workflows/typescript-code-analysis.yml'
37+
- '.github/workflows/*documentation.yml'
38+
39+
# Requires the secret NEO4J_INITIAL_PASSWORD to be configured
40+
jobs:
41+
analysis-results:
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
include:
46+
- os: ubuntu-latest
47+
java: 17
48+
python: 3.11
49+
miniforge: 24.9.0-0
50+
51+
env:
52+
CI_COMMIT_MESSAGE: Automated code structure analysis analysis-results (CI)
53+
CI_COMMIT_AUTHOR: ${{ github.event.repository.name }} Continuous Integration
54+
PROJECT_NAME: AxonFramework
55+
# Version variable name matches renovate.json configuration entry
56+
AXON_FRAMEWORK_VERSION: 4.10.3
57+
58+
steps:
59+
- name: Checkout GIT Repository
60+
uses: actions/checkout@v4
61+
with:
62+
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
63+
64+
- name: Checkout code-graph-analysis-pipeline
65+
uses: actions/checkout@v4
66+
with:
67+
repository: JohT/code-graph-analysis-pipeline
68+
ref: 41f3e22b5bd65351474dd23effeee91fab849a12
69+
path: code-graph-analysis-pipeline
70+
persist-credentials: false
71+
72+
- name: (Java Setup) Use Java Development Kit (JDK) ${{ matrix.java }}
73+
uses: actions/setup-java@v4
74+
with:
75+
distribution: 'adopt'
76+
java-version: ${{ matrix.java }}
77+
78+
# "Setup Python" can be skipped if jupyter notebook analysis-results aren't needed
79+
- name: (Python Setup) Setup Cache for Conda package manager Miniforge
80+
uses: actions/cache@v4
81+
env:
82+
# Increase this value to reset cache if etc/example-environment.yml has not changed
83+
# Reference: https://github.com/conda-incubator/setup-miniconda#caching
84+
CACHE_NUMBER: 0
85+
with:
86+
path: ~/conda_pkgs_dir
87+
key:
88+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-environments-${{hashFiles('**/environment.yml', '.github/workflows/*.yml') }}
89+
- name: (Python Setup) Use version ${{ matrix.python }} with Conda package manager Miniforge
90+
uses: conda-incubator/setup-miniconda@v3
91+
with:
92+
python-version: ${{ matrix.python }}
93+
miniforge-version: ${{ matrix.miniforge }}
94+
activate-environment: codegraph
95+
environment-file: ./code-graph-analysis-pipeline/jupyter/environment.yml
96+
auto-activate-base: false
97+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
98+
- name: (Python Setup) Conda environment info
99+
shell: bash -el {0}
100+
run: conda info
101+
102+
- name: (Code Analysis Setup) Add code-graph-analysis-pipeline temporarily to .gitignore
103+
run: |
104+
echo "" >> .gitignore
105+
echo "# Code Graph Analysis Pipeline" >> .gitignore
106+
echo "code-graph-analysis-pipeline/" >> .gitignore
107+
- name: (Code Analysis Setup) Set ANALYSIS_NAME
108+
run: echo "ANALYSIS_NAME=${{ env.PROJECT_NAME }}-${{ env.AXON_FRAMEWORK_VERSION }}" >> $GITHUB_ENV
109+
- name: (Code Analysis Setup) Generate NEO4J_INITIAL_PASSWORD
110+
run: echo "NEO4J_INITIAL_PASSWORD=$(LC_ALL=C tr -dc 'A-Za-z0-9!?%=' < /dev/urandom | head -c 10)" >> $GITHUB_ENV
111+
- name: (Code Analysis Setup) Setup Cache Analysis Downloads
112+
uses: actions/cache@v4
113+
with:
114+
path: ./code-graph-analysis-pipeline/temp/downloads
115+
key:
116+
${{ runner.os }}-${{ hashFiles('**/*.sh') }}
117+
118+
- name: (Code Analysis) Initialize Analysis
119+
working-directory: code-graph-analysis-pipeline
120+
env:
121+
NEO4J_INITIAL_PASSWORD: ${{ env.NEO4J_INITIAL_PASSWORD }}
122+
run: ./init.sh ${{ env.ANALYSIS_NAME }}
123+
- name: (Code Analysis) Download ${{ env.ANALYSIS_NAME }}
124+
working-directory: code-graph-analysis-pipeline/temp/${{ env.ANALYSIS_NAME }}
125+
run: |
126+
./../../scripts/downloader/downloadAxonFramework.sh ${{ env.AXON_FRAMEWORK_VERSION }}
127+
- name: (Code Analysis) Analyze ${{ env.ANALYSIS_NAME }}
128+
working-directory: code-graph-analysis-pipeline/temp/${{ env.ANALYSIS_NAME }}
129+
# Shell type can be skipped if jupyter notebook analysis-results (and therefore conda) aren't needed
130+
shell: bash -el {0}
131+
env:
132+
NEO4J_INITIAL_PASSWORD: ${{ env.NEO4J_INITIAL_PASSWORD }}
133+
ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION: "true"
134+
IMPORT_GIT_LOG_DATA_IF_SOURCE_IS_PRESENT: "" # Options: "none", "aggregated", "full". default = "plugin" or ""
135+
run: |
136+
./../../scripts/analysis/analyze.sh --profile Neo4jv5-low-memory
137+
- name: (Code Analysis) Collect analysis results
138+
working-directory: code-graph-analysis-pipeline/temp/${{ env.ANALYSIS_NAME }}
139+
run: |
140+
mkdir -p ./../../../analysis-results/${{ env.ANALYSIS_NAME }}
141+
cp -Rp reports ./../../../analysis-results/${{ env.ANALYSIS_NAME }}
142+
143+
# Upload logs and unfinished analysis-results in case of an error for troubleshooting
144+
- name: Archive failed run with logs and unfinished analysis-results
145+
if: failure()
146+
uses: actions/upload-artifact@v4
147+
with:
148+
name: java-code-analysis-logs-java-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}
149+
path: |
150+
./code-graph-analysis-pipeline/temp/**/runtime/*
151+
./code-graph-analysis-pipeline/temp/**/reports/*
152+
retention-days: 5
153+
154+
# Upload successful analysis-results in case they are needed for troubleshooting
155+
- name: Archive successful analysis-results
156+
if: success()
157+
uses: actions/upload-artifact@v4
158+
with:
159+
name: java-code-analysis-analysis-results-java-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}
160+
path: ./analysis-results/${{ env.ANALYSIS_NAME }}/*
161+
if-no-files-found: error
162+
retention-days: 5
163+
164+
# Upload Database Export
165+
# Only possible after an export with "./../../scripts/analysis/analyze.sh --report DatabaseCsvExport"
166+
# Won't be done here because of performance and security concerns
167+
#- name: Archive exported database
168+
# uses: actions/upload-artifact@v3
169+
# with:
170+
# name: java-code-analysis-database-export-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }}
171+
# path: ./code-graph-analysis-pipeline/temp/**/import
172+
# if-no-files-found: error
173+
# retention-days: 5
174+
175+
# Commit and push the native image agent analysis-results
176+
- name: Display environment variable "github.event_name"
177+
run: echo "github.event_name=${{ github.event_name }}"
178+
- name: Commit changes in the "analysis-results" directory
179+
# Only run when a pull request gets merged or a commit is pushed to the main branch
180+
# git add parameters need to match paths-ignore parameters above
181+
# Git pull before add/commit/push to reduce race conditions on parallel builds
182+
if: github.event_name == 'push'
183+
run: |
184+
git config --global user.name '${{ env.CI_COMMIT_AUTHOR }}'
185+
git config --global user.email "7671054+JohT@users.noreply.github.com"
186+
git config --local http.postBuffer 524288000
187+
git fetch origin
188+
git status
189+
git add analysis-results
190+
git status
191+
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
192+
git status
193+
git rebase --strategy-option=theirs origin/main --verbose
194+
git status
195+
git push --verbose

0 commit comments

Comments
 (0)