Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ops: using cache and 3.9.5 version about maven on workflow #52

Merged
merged 18 commits into from
Nov 28, 2023
18 changes: 7 additions & 11 deletions .github/workflows/code_review_functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,14 @@ jobs:
packages: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
apps/onboarding-functions
libs/
test-coverage/

- name: Set up JDK 17
uses: actions/setup-java@v3
- name: Setup Maven Action
uses: s4u/[email protected]
manuraf marked this conversation as resolved.
Show resolved Hide resolved
with:
checkout-fetch-depth: 0
java-version: 17
distribution: 'temurin'
java-distribution: 'temurin'
maven-version: '3.9.5'
cache-enabled: true

- name: Build and analyze on Pull Requests
shell: bash
Expand All @@ -43,7 +39,7 @@ jobs:
-Dsonar.token=${{ secrets.SONAR_TOKEN }}
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.head_ref }}
-Dsonar.pullrequest.base=${{ github.base_ref }}
-Dsonar.pullrequest.base=refs/remotes/origin/${{ github.base_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
13 changes: 7 additions & 6 deletions .github/workflows/code_review_libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ jobs:
packages: read
id-token: write
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
- name: Setup Maven Action
uses: s4u/[email protected]
with:
checkout-fetch-depth: 0
java-version: 17
distribution: 'temurin'
java-distribution: 'temurin'
maven-version: '3.9.5'
cache-enabled: true

- name: Build and analyze on Pull Requests
shell: bash
Expand All @@ -38,7 +39,7 @@ jobs:
-Dsonar.token=${{ secrets.SONAR_TOKEN }}
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.head_ref }}
-Dsonar.pullrequest.base=${{ github.base_ref }}
-Dsonar.pullrequest.base=refs/remotes/origin/${{ github.base_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
18 changes: 7 additions & 11 deletions .github/workflows/code_review_ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,14 @@ jobs:
packages: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
apps/onboarding-ms
libs/
test-coverage/

- name: Set up JDK 17
uses: actions/setup-java@v3
- name: Setup Maven Action
uses: s4u/[email protected]
manuraf marked this conversation as resolved.
Show resolved Hide resolved
with:
checkout-fetch-depth: 0
java-version: 17
distribution: 'temurin'
java-distribution: 'temurin'
maven-version: '3.9.5'
cache-enabled: true

- name: Build and analyze on Pull Requests
shell: bash
Expand All @@ -44,7 +40,7 @@ jobs:
-Dsonar.token=${{ secrets.SONAR_TOKEN }}
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.head_ref }}
-Dsonar.pullrequest.base=${{ github.base_ref }}
-Dsonar.pullrequest.base=refs/remotes/origin/${{ github.base_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
17 changes: 8 additions & 9 deletions .github/workflows/deploy_onboarding_functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,23 @@ jobs:
build:
name: Build Onboarding Functions
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == 'true') }}
if: ${{ (github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true) }}
environment: "${{ inputs.environment != null && inputs.environment || (github.base_ref == 'main' && 'prod' || (github.base_ref == 'develop' && 'uat' || 'dev')) }}-cd"
permissions:
packages: write
contents: write
id-token: write

steps:
- uses: actions/checkout@v4
name: Checkout
with:
ref: ${{ github.ref_name }}

- name: Set up JDK 17
uses: actions/setup-java@v3
- name: Setup Maven Action
uses: s4u/[email protected]
with:
checkout-fetch-depth: 0
checkout-ref: ${{ github.ref_name }}
java-version: 17
distribution: 'temurin'
java-distribution: 'temurin'
maven-version: '3.9.5'
cache-enabled: true

- name: "Build Functions and dependencies"
shell: bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.quarkus.test.vertx.RunOnVertxContext;
import io.quarkus.test.vertx.UniAsserter;
import io.smallrye.mutiny.Uni;
import it.pagopa.selfcare.azurestorage.AzureBlobClient;
import it.pagopa.selfcare.onboarding.common.InstitutionType;
import it.pagopa.selfcare.onboarding.common.PartyRole;
import it.pagopa.selfcare.onboarding.controller.request.*;
Expand Down Expand Up @@ -60,6 +61,9 @@ public class OnboardingServiceDefaultTest {
@InjectMock
ProductService productService;

@InjectMock
AzureBlobClient azureBlobClient;

@InjectMock
SignatureService signatureService;

Expand Down Expand Up @@ -599,6 +603,8 @@ void complete(UniAsserter asserter) {
mockSimpleProductValidAssert(onboarding.getProductId(), false, asserter);
mockVerifyOnboardingNotFound(asserter);

when(azureBlobClient.uploadFile(any(),any(),any())).thenReturn("upload-file");

asserter.assertThat(() -> onboardingService.complete(onboarding.getId().toHexString(), testFile),
Assertions::assertNotNull);
}
Expand Down