Initial Setup #8
Workflow file for this run
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 Java Code Structure Graph Analysis | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # Ignore changes in documentation, general configuration and analysis-results for push events | |
| paths-ignore: | |
| - 'analysis-results/**' | |
| - '**/*.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/**' | |
| - '**/*.md' | |
| - '**/*.txt' | |
| - '**/*.css' | |
| - '**/*.html' | |
| - '**/*.js' | |
| - '.gitignore' | |
| - '.gitattributes' | |
| - 'renovate.json' | |
| - '**.code-workspace' | |
| - '.github/workflows/typescript-code-analysis.yml' | |
| - '.github/workflows/*documentation.yml' | |
| # Requires the secret NEO4J_INITIAL_PASSWORD to be configured | |
| jobs: | |
| analysis-results: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| java: 17 | |
| python: 3.11 | |
| miniforge: 24.9.0-0 | |
| env: | |
| CI_COMMIT_MESSAGE: Automated code structure analysis analysis-results (CI) | |
| CI_COMMIT_AUTHOR: ${{ github.event.repository.name }} Continuous Integration | |
| PROJECT_NAME: AxonFramework | |
| # Version variable name matches renovate.json configuration entry | |
| AXON_FRAMEWORK_VERSION: 4.10.3 | |
| steps: | |
| - name: Checkout GIT Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }} | |
| - name: (Code Analysis Setup) Set ANALYSIS_NAME | |
| run: echo "ANALYSIS_NAME=${{ env.PROJECT_NAME }}-${{ env.AXON_FRAMEWORK_VERSION }}" >> $GITHUB_ENV | |
| - name: Setup Code Analysis | |
| uses: ./.github/workflows/setup-code-analysis.yml | |
| with: | |
| java-version: ${{ matrix.java }} | |
| python-version: ${{ matrix.python }} | |
| miniforge-version: ${{ matrix.miniforge }} | |
| analysis-name: ${{ env.ANALYSIS_NAME }} | |
| - name: (Code Analysis) Download ${{ env.ANALYSIS_NAME }} | |
| working-directory: code-graph-analysis-pipeline/temp/${{ env.ANALYSIS_NAME }} | |
| run: | | |
| ./../../scripts/downloader/downloadAxonFramework.sh ${{ env.AXON_FRAMEWORK_VERSION }} | |
| - name: (Code Analysis) Analyze ${{ env.ANALYSIS_NAME }} | |
| working-directory: code-graph-analysis-pipeline/temp/${{ env.ANALYSIS_NAME }} | |
| # Shell type can be skipped if jupyter notebook analysis-results (and therefore conda) aren't needed | |
| shell: bash -el {0} | |
| env: | |
| NEO4J_INITIAL_PASSWORD: ${{ env.NEO4J_INITIAL_PASSWORD }} | |
| ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION: "true" | |
| IMPORT_GIT_LOG_DATA_IF_SOURCE_IS_PRESENT: "" # Options: "none", "aggregated", "full". default = "plugin" or "" | |
| run: | | |
| ./../../scripts/analysis/analyze.sh --profile Neo4jv5-low-memory | |
| - name: (Code Analysis) Collect analysis results | |
| working-directory: code-graph-analysis-pipeline/temp/${{ env.ANALYSIS_NAME }} | |
| run: | | |
| mkdir -p ./../../../analysis-results/${{ env.ANALYSIS_NAME }} | |
| cp -Rp reports ./../../../analysis-results/${{ env.ANALYSIS_NAME }} | |
| # Upload logs and unfinished analysis-results in case of an error for troubleshooting | |
| - name: Archive failed run with logs and unfinished analysis-results | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: java-code-analysis-logs-java-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }} | |
| path: | | |
| ./code-graph-analysis-pipeline/temp/**/runtime/* | |
| ./code-graph-analysis-pipeline/temp/**/reports/* | |
| retention-days: 5 | |
| # Upload successful analysis-results in case they are needed for troubleshooting | |
| - name: Archive successful analysis-results | |
| if: success() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: java-code-analysis-analysis-results-java-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }} | |
| path: ./code-graph-analysis-pipeline/temp/**/reports/* | |
| if-no-files-found: error | |
| retention-days: 5 | |
| # Upload Database Export | |
| # Only possible after an export with "./../../scripts/analysis/analyze.sh --report DatabaseCsvExport" | |
| # Won't be done here because of performance and security concerns | |
| #- name: Archive exported database | |
| # uses: actions/upload-artifact@v3 | |
| # with: | |
| # name: java-code-analysis-database-export-${{ matrix.java }}-python-${{ matrix.python }}-miniforge-${{ matrix.miniforge }} | |
| # path: ./code-graph-analysis-pipeline/temp/**/import | |
| # if-no-files-found: error | |
| # retention-days: 5 | |
| # Commit and push the native image agent analysis-results | |
| - name: Display environment variable "github.event_name" | |
| run: echo "github.event_name=${{ github.event_name }}" | |
| - name: Commit "analysis-results" directory | |
| # Only run when a pull request gets merged or a commit is pushed to the main branch | |
| # git add parameters need to match paths-ignore parameters above | |
| # Git pull before add/commit/push to reduce race conditions on parallel builds | |
| if: github.event_name == 'push' | |
| run: | | |
| git config --global user.name '${{ env.CI_COMMIT_AUTHOR }}' | |
| git config --global user.email "7671054+JohT@users.noreply.github.com" | |
| git config --local http.postBuffer 524288000 | |
| git fetch origin | |
| git status | |
| git add analysis-results | |
| git status | |
| git commit -m "${{ env.CI_COMMIT_MESSAGE }}" | |
| git status | |
| git rebase --strategy-option=theirs origin/main --verbose | |
| git status | |
| git push --verbose |