generated from pagopa/pagopa-functions-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EC-95] Reusable workflows for code review pipelines (#97)
- Loading branch information
Showing
10 changed files
with
188 additions
and
161 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
functions: | ||
- apps/onboarding-functions/** | ||
- changed-files: | ||
- any-glob-to-any-file: ['apps/onboarding-functions/**'] | ||
|
||
onboarding-ms: | ||
- apps/onboarding-ms/** | ||
- changed-files: | ||
- any-glob-to-any-file: ['apps/onboarding-ms/**'] | ||
|
||
libs: | ||
- libs/** | ||
- changed-files: | ||
- any-glob-to-any-file: ['libs/**'] | ||
|
||
ops: | ||
- .github/** | ||
- infra/** | ||
- .identity/** | ||
- changed-files: | ||
- any-glob-to-any-file: ['.github/**', 'infra/**', '.identity/**'] | ||
|
||
docs: | ||
- README.md | ||
- changed-files: | ||
- any-glob-to-any-file: ['README.md'] | ||
|
||
hotfix: | ||
- base-branch: ['releases/*'] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
pr_number: | ||
type: string | ||
required: true | ||
source_branch: | ||
type: string | ||
required: true | ||
target_branch: | ||
type: string | ||
required: true | ||
sonar_key: | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
code_review: | ||
name: 'Build & Analysis' | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
|
||
- name: Setup Maven Action | ||
uses: s4u/setup-maven-action@fa2c7e4517ed008b1f73e7e0195a9eecf5582cd4 | ||
with: | ||
checkout-fetch-depth: 0 | ||
java-version: 17 | ||
java-distribution: 'temurin' | ||
maven-version: '3.9.5' | ||
cache-enabled: true | ||
|
||
- name: Build and Analyze | ||
shell: bash | ||
run: mvn --projects :test-coverage --also-make verify -Ponboarding-ms,report,coverage | ||
-Dsonar.organization=pagopa | ||
-Dsonar.projectKey=${{ inputs.sonar_key }} | ||
-Dsonar.token=${{ secrets.SONAR_TOKEN }} | ||
-Dsonar.pullrequest.key=${{ inputs.pr_number }} | ||
-Dsonar.pullrequest.branch=${{ inputs.source_branch }} | ||
-Dsonar.pullrequest.base=refs/remotes/origin/${{ inputs.target_branch }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Code Review onboarding-functions | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
- ready_for_review | ||
paths: | ||
- 'apps/onboarding-functions/**' | ||
- 'apps/onboarding-ms/pom.xml' | ||
- '.github/workflows/code_review_functions.yml' | ||
- '.github/workflows/call_code_review.yml' | ||
|
||
jobs: | ||
|
||
code_review: | ||
uses: ./.github/workflows/call_code_review.yml | ||
name: OnBoarding function Code Review | ||
secrets: inherit | ||
with: | ||
pr_number: ${{ github.event.pull_request.number }} | ||
source_branch: ${{ github.head_ref }} | ||
target_branch: ${{ github.base_ref }} | ||
sonar_key: 'pagopa_selfcare-onboarding' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: PR - Labeler | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
- releases/** | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
labeler: | ||
name: PR Labeler | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5 | ||
with: | ||
sync-labels: true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Code Review Libs | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
- ready_for_review | ||
paths: | ||
- 'libs/**' | ||
- '.github/workflows/code_review_libs.yml' | ||
- '.github/workflows/call_code_review.yml' | ||
|
||
jobs: | ||
|
||
code_review: | ||
uses: ./.github/workflows/call_code_review.yml | ||
name: Libs Code Review | ||
secrets: inherit | ||
with: | ||
pr_number: ${{ github.event.pull_request.number }} | ||
source_branch: ${{ github.head_ref }} | ||
target_branch: ${{ github.base_ref }} | ||
sonar_key: 'pagopa_selfcare-onboarding' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Code Review onboarding-ms | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
- ready_for_review | ||
paths: | ||
- 'apps/onboarding-ms/**' | ||
- 'apps/onboarding-ms/pom.xml' | ||
- '.github/workflows/code_review_ms.yml' | ||
- '.github/workflows/call_code_review.yml' | ||
|
||
jobs: | ||
|
||
code_review: | ||
uses: ./.github/workflows/call_code_review.yml | ||
name: OnBoarding ms Code Review | ||
secrets: inherit | ||
with: | ||
pr_number: ${{ github.event.pull_request.number }} | ||
source_branch: ${{ github.head_ref }} | ||
target_branch: ${{ github.base_ref }} | ||
sonar_key: 'pagopa_selfcare-onboarding' |
Oops, something went wrong.