Merge pull request #103 from JohT/renovate/code-graph-analysis-pipeli… #409
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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@561e305a96603d046b838efc08760af47786e1b2 # 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: 561e305a96603d046b838efc08760af47786e1b2 # 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 }} |