-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (123 loc) · 6.61 KB
/
java-code-analysis.yml
File metadata and controls
138 lines (123 loc) · 6.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: AxonFramework Code Graph Analysis (Java)
on:
push:
branches:
- main
# Ignore changes in documentation, general configuration and analysis-results for push events
paths-ignore:
- 'analysis-results/**'
- 'documentation/**'
- '**/*.md'
- '**/*.txt'
- '**/*.css'
- '**/*.html'
- '**/*.js'
- '.gitignore'
- '.gitattributes'
- 'renovate.json'
- '**.code-workspace'
- '.github/workflows/typescript-code-analysis.yml'
- '.github/workflows/*documentation.yml'
pull_request:
branches:
- main
# Ignore changes in documentation, general configuration and analysis-results for pull request events
paths-ignore:
- 'analysis-results/**'
- 'documentation/**'
- '**/*.md'
- '**/*.txt'
- '**/*.css'
- '**/*.html'
- '**/*.js'
- '.gitignore'
- '.gitattributes'
- 'renovate.json'
- '**.code-workspace'
- '.github/workflows/typescript-code-analysis.yml'
- '.github/workflows/*documentation.yml'
jobs:
prepare-code-to-analyze:
name: Prepare Code to Analyze
runs-on: ubuntu-latest
env:
PROJECT_NAME: AxonFramework
# Version variable names matches renovate.json configuration entry
AXON_FRAMEWORK_VERSION: 4.12.1
# Java is in this example only used to download JARs for analysis using Maven
JAVA_VERSION: 21
outputs:
project-name: ${{ env.PROJECT_NAME }}
analysis-name: ${{ steps.set-analysis-name.outputs.analysis-name }}
sources-upload-name: ${{ steps.set-sources-upload-name.outputs.sources-upload-name }}
artifacts-upload-name: ${{ steps.set-artifacts-upload-name.outputs.artifacts-upload-name }}
steps:
- name: (Prepare Code to Analyze) Checkout AxonFramework repository
run: |
git clone --bare https://github.com/AxonFramework/AxonFramework.git --branch "axon-${{ env.AXON_FRAMEWORK_VERSION }}" --single-branch "./source/AxonFramework-${{ env.AXON_FRAMEWORK_VERSION }}/.git"
- name: (Prepare Code to Analyze) Setup Java Development Kit for Maven JARs downloading (JDK) ${{ env.JAVA_VERSION}}
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
with:
distribution: "temurin"
java-version: ${{ env.JAVA_VERSION}}
- name: (Prepare Code to Analyze) Download AxonFramework JARs for analysis
run: |
mvn dependency:copy -Dartifact=org.axonframework:axon-configuration:${{ env.AXON_FRAMEWORK_VERSION }} -DoutputDirectory=./artifacts
mvn dependency:copy -Dartifact=org.axonframework:axon-disruptor:${{ env.AXON_FRAMEWORK_VERSION }} -DoutputDirectory=./artifacts
mvn dependency:copy -Dartifact=org.axonframework:axon-eventsourcing:${{ env.AXON_FRAMEWORK_VERSION }} -DoutputDirectory=./artifacts
mvn dependency:copy -Dartifact=org.axonframework:axon-messaging:${{ env.AXON_FRAMEWORK_VERSION }} -DoutputDirectory=./artifacts
mvn dependency:copy -Dartifact=org.axonframework:axon-modelling:${{ env.AXON_FRAMEWORK_VERSION }} -DoutputDirectory=./artifacts
mvn dependency:copy -Dartifact=org.axonframework:axon-test:${{ env.AXON_FRAMEWORK_VERSION }} -DoutputDirectory=./artifacts
mvn dependency:copy -Dartifact=org.axonframework:axon-server-connector:${{ env.AXON_FRAMEWORK_VERSION }} -DoutputDirectory=./artifacts
mvn dependency:copy -Dartifact=org.axonframework:axon-spring-boot-autoconfigure:${{ env.AXON_FRAMEWORK_VERSION }} -DoutputDirectory=./artifacts
mvn dependency:copy -Dartifact=org.axonframework:axon-tracing-opentelemetry:${{ env.AXON_FRAMEWORK_VERSION }} -DoutputDirectory=./artifacts
- name: (Prepare Code to Analyze) Set analysis-name
id: set-analysis-name
run: echo "analysis-name=${{ env.PROJECT_NAME }}-${{ env.AXON_FRAMEWORK_VERSION }}" >> "$GITHUB_OUTPUT"
- name: (Prepare Code to Analyze) Generate ARTIFACT_UPLOAD_ID
run: echo "ARTIFACT_UPLOAD_ID=$(LC_ALL=C tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 10)" >> $GITHUB_ENV
- name: (Prepare Code to Analyze) Set sources-upload-name
id: set-sources-upload-name
run: echo "sources-upload-name=${{ steps.set-analysis-name.outputs.analysis-name }}-analysis-sources_input-${{ env.ARTIFACT_UPLOAD_ID }}" >> "$GITHUB_OUTPUT"
- name: (Prepare Code to Analyze) Assemble ARTIFACTS_UPLOAD_NAME
id: set-artifacts-upload-name
run: echo "artifacts-upload-name=${{ steps.set-analysis-name.outputs.analysis-name }}-analysis-artifacts-input-${{ env.ARTIFACT_UPLOAD_ID }}" >> "$GITHUB_OUTPUT"
- name: (Prepare Code to Analyze) Upload sources to analyze
if: success()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ steps.set-sources-upload-name.outputs.sources-upload-name }}
path: ./source
include-hidden-files: true
if-no-files-found: error
retention-days: 1
- name: (Prepare Code to Analyze) Upload artifacts to analyze
if: success()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ steps.set-artifacts-upload-name.outputs.artifacts-upload-name }}
path: ./artifacts
if-no-files-found: error
retention-days: 1
analyze-code-graph:
name: Analyze Code Graph
needs: [prepare-code-to-analyze]
uses: JohT/code-graph-analysis-pipeline/.github/workflows/public-analyze-code-graph.yml@f5e24f261cb70d9aeeb4cc101573810f80bd465d # main
with:
analysis-name: ${{ needs.prepare-code-to-analyze.outputs.analysis-name }}
artifacts-upload-name: ${{ needs.prepare-code-to-analyze.outputs.artifacts-upload-name }}
sources-upload-name: ${{ needs.prepare-code-to-analyze.outputs.sources-upload-name }}
ref: f5e24f261cb70d9aeeb4cc101573810f80bd465d # main
commit-analysis-results:
name: Commit Analysis Results
needs: [prepare-code-to-analyze, analyze-code-graph]
uses: ./.github/workflows/internal-commit-results.yml
with:
commit-author-name: "${{ github.event.repository.name }} Continuous Integration"
commit-author-email: "7671054+JohT@users.noreply.github.com"
commit-message: "Automated code structure analysis results (CI)"
commit-directory: "analysis-results/${{ needs.prepare-code-to-analyze.outputs.project-name }}/${{ needs.prepare-code-to-analyze.outputs.analysis-name }}"
second-commit-directory: "analysis-results/${{ needs.prepare-code-to-analyze.outputs.project-name }}/latest"
uploaded-artifact-name: ${{ needs.analyze-code-graph.outputs.uploaded-analysis-results }}
secrets:
repository-commit-token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}