Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/internal-commit-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Commit Results

on:
workflow_call:
inputs:
commit-author-name:
description: "The display name of the commit author"
required: false
type: string
default: '${{ github.event.repository.name }} Continuous Integration'
commit-author-email:
description: "The email address of the commit author"
required: true
type: string
commit-message:
description: "The commit message"
required: false
type: string
default: "ci: Add automated results"
commit-directory:
description: "The directory to commit"
required: true
type: string
uploaded-artifact-name:
description: "The name of the uploaded artifact"
required: true
type: string
secrets:
repository-commit-token:
description: "The token to use for committing to the repository"
required: true

jobs:
commit-results:
runs-on: ubuntu-latest

steps:
- name: Checkout GIT Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
token: ${{ secrets.repository-commit-token }}

- name: Download artifacts to commit
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
name: ${{ inputs.uploaded-artifact-name }}
path: ${{ inputs.commit-directory }}

- name: Display environment variable "github.event_name"
run: echo "github.event_name=${{ github.event_name }}"

- name: Prepare commit of changes in `${{ inputs.commit-directory }}`
run: |
git config --global user.name '${{ inputs.commit-author-name }}'
git config --global user.email '${{ inputs.commit-author-email }}'
git config --local http.postBuffer 524288000
git fetch origin
git status
git add ${{ inputs.commit-directory }}
git status

- name: Commit and push changes in `${{ inputs.commit-directory }}`
# Only run when a pull request gets merged or a commit is pushed to the main branch
if: github.event_name == 'push'
run: |
git commit --message "${{ inputs.commit-message }}"
git status
git rebase --strategy-option=theirs origin/main --verbose
git status
git add ${{ inputs.commit-directory }}
git status
git push --verbose
72 changes: 21 additions & 51 deletions .github/workflows/java-code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,19 @@ on:

jobs:
prepare-code-to-analyze:
name: Prepare Code to Analyze
runs-on: ubuntu-latest
outputs:
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 }}

env:
PROJECT_NAME: AxonFramework
# Version variable names matches renovate.json configuration entry
AXON_FRAMEWORK_VERSION: 4.10.3
# 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
Expand Down Expand Up @@ -98,6 +99,7 @@ jobs:
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

Expand All @@ -112,57 +114,25 @@ jobs:


analyze-code-graph:
name: Analyze Code Graph
needs: [prepare-code-to-analyze]
uses: ./.github/workflows/analyze-code-graph.yml
uses: JohT/code-graph-analysis-pipeline/.github/workflows/public-analyze-code-graph.yml@7f43cf96d676f715cf278b020ce1dbb3338f900b # v2
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: 7f43cf96d676f715cf278b020ce1dbb3338f900b


analysis-results:
commit-analysis-results:
name: Commit Analysis Results
needs: [prepare-code-to-analyze, analyze-code-graph]
runs-on: ubuntu-latest

env:
CI_COMMIT_MESSAGE: Automated code structure analysis analysis-results (CI)
CI_COMMIT_AUTHOR: ${{ github.event.repository.name }} Continuous Integration

steps:
- name: Checkout GIT Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}

- name: (Code Analysis Setup) Download source code and artifacts for analysis
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
name: ${{ needs.analyze-code-graph.outputs.uploaded-analysis-results }}
path: analysis-results/${{ needs.prepare-code-to-analyze.outputs.analysis-name }}

# 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: Display changes in the "analysis-results" directory and prepare commit
# 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
run: |
git config --global user.name '${{ env.CI_COMMIT_AUTHOR }}'
git config --global user.email "[email protected]"
git config --local http.postBuffer 524288000
git fetch origin
git status
git add analysis-results
git status
- name: Commit and push changes in the "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 commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git status
git rebase --strategy-option=theirs origin/main --verbose
git status
git push --verbose
uses: ./.github/workflows/internal-commit-results.yml
with:
commit-author-name: "${{ github.event.repository.name }} Continuous Integration"
commit-author-email: "[email protected]"
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 }}"
uploaded-artifact-name: ${{ needs.analyze-code-graph.outputs.uploaded-analysis-results }}
secrets:
repository-commit-token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
63 changes: 17 additions & 46 deletions .github/workflows/typescript-code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ on:

jobs:
prepare-code-to-analyze:
name: Prepare Code to Analyze
runs-on: ubuntu-latest
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 }}

Expand Down Expand Up @@ -79,61 +81,30 @@ jobs:
with:
name: ${{ steps.set-sources-upload-name.outputs.sources-upload-name }}
path: .
include-hidden-files: true
if-no-files-found: error
retention-days: 1


analyze-code-graph:
name: Analyze Code Graph
needs: [prepare-code-to-analyze]
uses: ./.github/workflows/analyze-code-graph.yml
uses: JohT/code-graph-analysis-pipeline/.github/workflows/public-analyze-code-graph.yml@7f43cf96d676f715cf278b020ce1dbb3338f900b # v2
with:
analysis-name: ${{ needs.prepare-code-to-analyze.outputs.analysis-name }}
sources-upload-name: ${{ needs.prepare-code-to-analyze.outputs.sources-upload-name }}
ref: 7f43cf96d676f715cf278b020ce1dbb3338f900b


analysis-results:
commit-analysis-results:
name: Commit Analysis Results
needs: [prepare-code-to-analyze, analyze-code-graph]
runs-on: ubuntu-latest

env:
CI_COMMIT_MESSAGE: Automated code structure analysis analysis-results (CI)
CI_COMMIT_AUTHOR: ${{ github.event.repository.name }} Continuous Integration

steps:
- name: Checkout GIT Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}

- name: (Code Analysis Setup) Download source code and artifacts for analysis
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
name: ${{ needs.analyze-code-graph.outputs.uploaded-analysis-results }}
path: analysis-results/${{ needs.prepare-code-to-analyze.outputs.analysis-name }}

# 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: Display changes in the "analysis-results" directory and prepare commit
# 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
run: |
git config --global user.name '${{ env.CI_COMMIT_AUTHOR }}'
git config --global user.email "[email protected]"
git config --local http.postBuffer 524288000
git fetch origin
git status
git add analysis-results
git status
- name: Commit and push changes in the "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 commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git status
git rebase --strategy-option=theirs origin/main --verbose
git status
git push --verbose
uses: ./.github/workflows/internal-commit-results.yml
with:
commit-author-name: "${{ github.event.repository.name }} Continuous Integration"
commit-author-email: "[email protected]"
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 }}"
uploaded-artifact-name: ${{ needs.analyze-code-graph.outputs.uploaded-analysis-results }}
secrets:
repository-commit-token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
17 changes: 14 additions & 3 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
],
"ignoreUnstable": false,
"packageRules": [
{
"description": "Code Graph Analysis Pipeline Workflow",
"groupName": [
"Code Graph Analysis Pipeline Workflow"
],
"matchSourceUrls": [
"https://github.com/JohT/code-graph-analysis-pipeline"
],
"matchUpdateTypes": [
"digest"
]
}
],
"customManagers": [
{
Expand Down Expand Up @@ -95,16 +107,15 @@
"extractVersionTemplate": "^(?<version>\\d+).*$"
},
{
"description": "Update code-graph-analysis-pipeline repository commit hash",
"description": "Update code-graph-analysis-pipeline ref parameter",
"customType": "regex",
"fileMatch": [
"(^|/)(workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$",
"(^|/)action\\.ya?ml$"
],
"matchStringsStrategy": "combination",
"matchStrings": [
"uses: actions/checkout@v*\\s",
"repository:\\s*JohT/code-graph-analysis-pipeline\\s",
"uses: JohT/code-graph-analysis-pipeline/.github/workflows/public-analyze-code-graph.yml*\\s*",
"ref:\\s*(?<currentDigest>.*?)\\s"
],
"packageNameTemplate": "https://github.com/JohT/code-graph-analysis-pipeline",
Expand Down
Loading