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
4 changes: 2 additions & 2 deletions .github/workflows/check_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
name: Add label to PR based on the paths of files being changed
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@ac9175f8a1f3625fd0d4fb234536d26811351594 # pin@v4

check_pr_size:
name: Check PR size doesn't break set limit
runs-on: ubuntu-latest
steps:
# checkout your code with your git history
- uses: actions/checkout@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
with:
fetch-depth: 0

Expand Down
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/setup-maven-action@fa2c7e4517ed008b1f73e7e0195a9eecf5582cd4 # [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 @@ -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/setup-maven-action@fa2c7e4517ed008b1f73e7e0195a9eecf5582cd4 # [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 }}
21 changes: 9 additions & 12 deletions .github/workflows/code_review_ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ on:
- reopened
paths:
- 'apps/onboarding-ms/**'

workflow_dispatch:


jobs:

code-review:
Expand All @@ -23,18 +24,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/setup-maven-action@fa2c7e4517ed008b1f73e7e0195a9eecf5582cd4 # [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 @@ -44,7 +41,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/setup-maven-action@fa2c7e4517ed008b1f73e7e0195a9eecf5582cd4 # [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
7 changes: 4 additions & 3 deletions .github/workflows/release_onboarding_sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@ name: Release onboarding sdk
on:
workflow_dispatch:


jobs:
setup:
name: Release
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
with:
ref: ${{ github.ref_name }}

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # pin@v3
with:
distribution: 'temurin'
java-version: '17'
cache: maven

- uses: s4u/[email protected]
- uses: s4u/maven-settings-action@60912582505985be4cc55d2b890eb32767f8de5f # pin@v2.8.0
with:
servers: '[{"id": "selfcare-github", "username": "${{ github.actor }}", "password": "${{ secrets.GITHUB_TOKEN }}"}]'

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
Loading