-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (125 loc) · 4.1 KB
/
ci_code_review.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Code Review
# Controls when the workflow will run
on:
merge_group:
pull_request:
types:
- opened
- synchronize
- reopened
- closed
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
PROJECT_KEY: pagopa_pagopa-selfcare-ms-backoffice-backend
permissions:
id-token: write
packages: write
contents: write
deployments: write
issues: write
pull-requests: write
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
print_debug:
runs-on: ubuntu-latest
steps:
- name: Dump Inputs
env:
JSON_INPUTS: ${{ toJson(inputs) }}
run: echo "$JSON_INPUTS"
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"
- name: Dump runner context
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
- name: Dump strategy context
env:
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
run: echo "$STRATEGY_CONTEXT"
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: echo "$MATRIX_CONTEXT"
code-review:
name: Code Review
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Test and Coverage
uses: pagopa/github-actions-template/maven-code-review@186af0dfc5ee51e6150046051d4e0b6444e15aed # v1.10.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
project_key: ${{env.PROJECT_KEY}}
coverage_exclusions: "**/config/*,**/*Mock*,**/model/**,**/entity/*,**/exception/**"
cpd_exclusions: "**/model/**,**/entity/*"
java_version: 17
# image:
# name: Build and Push Docker Image
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
#
# - name: Login to GitHub Container Registry
# uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Docker meta
# id: meta
# uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0
# with:
# images: ghcr.io/${{ github.repository }}
# tags: |
# ${{ github.event.number }}
# ${{ inputs.tag }}
# type=ref,event=branch
# type=sha
#
# - name: Build and push
# uses: docker/build-push-action@1104d471370f9806843c095c1db02b5a90c5f8b6 # v3
# with:
# context: .
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
#
#
# deploy:
# name: Deploy in DEV
# needs: [ image ]
# uses: ./.github/workflows/deploy_with_github_runner.yml
# with:
# environment: 'dev'
# branch: ${{ github.head_ref }}
# helm_options: '--set microservice-chart.fullnameOverride=pagopaselfcaremsbackofficebackend-${{ github.event.number }} --set microservice-chart.image.tag=${{ github.event.number }} --set microservice-chart.ingress.path="/selfcare/pagopa/${{ github.event.number }}/(.*)"'
# terraform_options: '-target=module.apim_api_backoffice_api_staging'
# suffix_name: '-${{ github.event.number }}'
# pr_number: ${{ github.event.number }}
# secrets: inherit
smoke_test:
name: Smoke Test
if: github.event_name == 'pull_request' || github.event_name == 'merge_group'
uses: ./.github/workflows/ci_integration_test.yml
with:
environment: 'local'
notify: false
secrets: inherit