Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into MCIL-23-update-terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoGiuliani authored Apr 18, 2024
2 parents 0142f46 + 3689f14 commit c9565da
Show file tree
Hide file tree
Showing 9 changed files with 491 additions and 116 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/check-openapi-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check OpenApi version

on:
pull_request:
branches:
- main
paths:
- 'src/main/resources/META-INF/openapi.yaml'

jobs:
checkOpenApi:
name: Diff with main
runs-on: ubuntu-latest

steps:
- name: Checkout the source code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Get the branch openapi version
id: branch_openapi_version
uses: mikefarah/yq@c35ec752e38ea0c096d3c44e13cfc0797ac394d8 #v4.43.1
with:
cmd: yq '.info.version' src/main/resources/META-INF/openapi.yaml

- name: Download openapi main
run: wget https://raw.githubusercontent.com/pagopa/mil-terminal-registry/main/src/main/resources/META-INF/openapi.yaml

- name: Get the main openapi version
id: main_openapi_version
uses: mikefarah/yq@c35ec752e38ea0c096d3c44e13cfc0797ac394d8 #v4.43.1
with:
cmd: yq '.info.version' openapi.yaml

- name: Fail if versions are equals
if: steps.branch_openapi_version.output.result == steps.main_openapi_version.output.result
run: exit 1
38 changes: 19 additions & 19 deletions .github/workflows/post-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,29 +118,29 @@ jobs:
resourceGroup: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
imageToDeploy: ghcr.io/${{ github.repository }}:${{ steps.semantic.outputs.new_release_version }}-RC@${{ steps.docker_build_push_candidate.outputs.digest }}

# #
# # Install Node.
# #
# - name: Install Node
# if: steps.semantic.outputs.new_release_published == 'true'
# uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
# with:
# node-version: "18.16.0"
#
# #
# # Install Newman.
# #
# - name: Install Newman
# if: steps.semantic.outputs.new_release_published == 'true'
# run: npm install -g newman
#
# Install Node.
#
- name: Install Node
if: steps.semantic.outputs.new_release_published == 'true'
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version: "18.16.0"

#
# Run Postman collection.
# Install Newman.
#
# - name: Run Postman collection
# if: steps.semantic.outputs.new_release_published == 'true'
# run: newman run src/test/postman/mil-auth.postman_collection.json -e src/test/postman/dev.postman_environment.json
- name: Install Newman
if: steps.semantic.outputs.new_release_published == 'true'
run: npm install -g newman

#
# Run Postman collection.
#
- name: Run Postman collection
if: steps.semantic.outputs.new_release_published == 'true'
run: newman run src/test/postman/mil-terminal-registry.postman_collection.json -e src/test/postman/dev.postman_environment.json

#
# STABLE - Update of gradle.properties with the new version.
#
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/pre-merge-postman-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Pull request review

on:
pull_request:
branches:
- main
types:
- opened
- edited
- synchronize

env:
TARGET_PLATFORMS: linux/amd64

jobs:
postman_test:
name: Postamn test
runs-on: ubuntu-latest
environment: dev-cd

permissions:
id-token: write
packages: write
contents: write

steps:
- name: Checkout the source code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
token: ${{ secrets.GIT_GITHUB_TOKEN }}
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 #v3.0.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 #v3.0.0

- name: Setup Java
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
with:
distribution: 'corretto'
java-version: '21'
cache: 'gradle'

- name: Log in to the Container registry
id: docker_login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d #v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.BOT_WRITE_PACKAGE_TOKEN }}

- name: Login to Azure
uses: azure/login@8c334a195cbb38e46038007b304988d888bf676a #v2.0.0
with:
client-id: ${{ secrets.AZURE_CD_IDENTITY_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_CD_IDENTITY_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

#
# RELEASE CANDIDATE - Execute unit-test + Calculate test coverage + SCA with Sonar.
#
- name: RELEASE CANDIDATE - Execute unit-test + Calculate test coverage + Sonar
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew clean build jacocoTestReport jacocoTestCoverageVerification sonar

#
# Install Node.
#
- name: Install Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version: "18.16.0"

#
# Install Newman.
#
- name: Install Newman
run: npm install -g newman

#
# Run Postman collection.
#
- name: Run Postman collection
run: newman run src/test/postman/mil-terminal-registry.postman_collection.json -e src/test/postman/dev.postman_environment.json --env-var "tr_token_client_id=${{ secrets.NEWMAN_IT__TR_TOKEN_CLIENT_ID }}" --env-var "tr_token_client_secret=${{ secrets.NEWMAN_IT__TR_TOKEN_CLIENT_SECRET }}"
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
11 changes: 3 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ dependencies {
implementation 'io.quarkus:quarkus-mongodb-panache'
implementation 'org.eclipse.microprofile.jwt:microprofile-jwt-auth-api'
implementation 'io.quarkus:quarkus-smallrye-jwt'
implementation 'io.quarkus:quarkus-test-security'
implementation 'io.quarkus:quarkus-test-security-jwt'


testImplementation 'io.quarkus:quarkus-test-security'
testImplementation 'io.quarkus:quarkus-test-security-jwt'
testImplementation 'io.quarkus:quarkus-junit5'
testImplementation 'io.rest-assured:rest-assured'
testImplementation "io.quarkus:quarkus-jacoco"
Expand Down Expand Up @@ -58,11 +58,6 @@ jacoco {
toolVersion = "${jacocoToolVersion}"
}

// runs jacocoTestCoverageVerification before complete check
check {
dependsOn jacocoTestCoverageVerification
}

def jacocoQuarkusPath = project.layout.buildDirectory.file("jacoco-quarkus.exec")

// allows to collect jacoco coverage on non-quarkus test
Expand Down
Loading

0 comments on commit c9565da

Please sign in to comment.