Skip to content

Commit

Permalink
reusable for function
Browse files Browse the repository at this point in the history
  • Loading branch information
Krusty93 committed Jan 22, 2024
1 parent 5dfacfc commit 52a4138
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 36 deletions.
45 changes: 16 additions & 29 deletions .github/workflows/code_review_functions.yml
Original file line number Diff line number Diff line change
@@ -1,44 +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/**'

workflow_dispatch:
- 'apps/onboarding-ms/pom.xml'
- '.github/workflows/code_review_functions.yml'
- '.github/workflows/call_code_review.yml'

jobs:

code-review:
runs-on: ubuntu-latest
permissions:
packages: read
id-token: write
steps:
- name: Setup Maven Action
uses: s4u/setup-maven-action@fa2c7e4517ed008b1f73e7e0195a9eecf5582cd4 # [email protected]
with:
checkout-fetch-depth: 0
java-version: 17
java-distribution: 'temurin'
maven-version: '3.9.5'
cache-enabled: true

- name: Build and analyze on Pull Requests
shell: bash
run: mvn --projects :test-coverage --also-make verify -Ponboarding-functions,report,coverage
-Dsonar.organization=pagopa
-Dsonar.projectKey=pagopa_selfcare-onboarding
-Dsonar.token=${{ secrets.SONAR_TOKEN }}
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.head_ref }}
-Dsonar.pullrequest.base=refs/remotes/origin/${{ github.base_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
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'
9 changes: 2 additions & 7 deletions .github/workflows/code_review_ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@ on:
- edited
- synchronize
- reopened
# - ready_for_review # TODO: re enable
- ready_for_review
paths:
- 'apps/onboarding-ms/**'
- 'apps/onboarding-ms/pom.xml'
- '.github/workflows/code_review_ms.yml'
- '.github/workflows/templates/call_code_review.yml'

# TODO: remove, just for testing
push:
branches:
- EC-95-pipeline-code-review-con-reusable-workflows
- '.github/workflows/call_code_review.yml'

jobs:

Expand Down

0 comments on commit 52a4138

Please sign in to comment.