Skip to content

Commit

Permalink
ops: code reviews as template (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuraf authored Oct 19, 2023
1 parent b2995d6 commit 8a08732
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 25 deletions.
36 changes: 12 additions & 24 deletions .github/workflows/code_review.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,24 @@
name: Code Review

# Controls when the workflow will run
on:
pull_request:
branches:
- main
- develop
types:
- opened
- synchronize
- reopened
paths:
- 'onboarding-ms/**'
- 'onboarding-functions/**'
- 'onboarding-sdk/**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
id-token: write
contents: read
deployments: write
workflow_call:
inputs:
module:
required: true
type: choice
description: Select the module
options:
- onboarding-ms
- onboarding-functions

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:

code-review:
name: Code Review onboarding-ms
# The type of runner that the job will run on
runs-on: ubuntu-latest

env:
module: ${{ inputs.module || env.MODULE }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -67,7 +55,7 @@ jobs:
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.head_ref }}
-Dsonar.pullrequest.base=${{ github.base_ref }}
--file ./pom.xml
--file ${{ inputs.module }}/pom.xml
env:
# Needed to get some information about the pull request, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/code_review_functions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Code Review Functions

# Controls when the workflow will run
on:
pull_request:
branches:
- main
- develop
types:
- opened
- synchronize
- reopened
paths:
- 'onboarding-functions/**'

permissions:
id-token: write
contents: read
deployments: write

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:

code-review:
name: Code review onboarding-ms
# The type of runner that the job will run on
uses: pagopa/selfcare-onboarding/.github/workflows/code_review.yml@develop
with:
module: onboarding-functions
29 changes: 29 additions & 0 deletions .github/workflows/code_review_ms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Code Review MS

# Controls when the workflow will run
on:
pull_request:
branches:
- main
- develop
types:
- opened
- synchronize
- reopened
paths:
- 'onboarding-ms/**'

permissions:
id-token: write
contents: read
deployments: write

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:

code-review:
name: Code review onboarding-ms
# The type of runner that the job will run on
uses: pagopa/selfcare-onboarding/.github/workflows/code_review.yml@develop
with:
module: onboarding-ms
1 change: 0 additions & 1 deletion onboarding-ms/deploy-image-container-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ properties:
value: $ONBOARDING_FUNCTIONS_URL$
- name: ONBOARDING_ALLOWED_INSTITUTIONS_PRODUCTS
value: $ONBOARDING_ALLOWED_INSTITUTIONS_PRODUCTS$

scale:
minReplicas: 1
maxReplicas: 5

0 comments on commit 8a08732

Please sign in to comment.