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

Feature/skip test report from fork pr #784

Merged
merged 5 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflow-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,15 +32,13 @@ jobs:
run: mvn test -f {{SERVICE_NAME}}
- name: Unit Test Results
uses: dorny/test-reporter@v1
if: |
${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} &&
(success() || failure())
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Unit-Test-Results
path: "{{SERVICE_NAME}}/**/surefire-reports/*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f {{SERVICE_NAME}}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/backoffice-bff-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -27,7 +29,7 @@ jobs:
- name: Run Maven Build Command
run: mvn clean install -DskipTests -f backoffice-bff
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f backoffice-bff
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/backoffice-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -35,7 +37,7 @@ jobs:
- run: npx prettier --check .
working-directory: backoffice
- name: SonarCloud Scan
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
uses: SonarSource/sonarcloud-github-action@master
with:
projectBaseDir: backoffice
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cart-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,15 +32,13 @@ jobs:
run: mvn test -pl cart -am
- name: Unit Test Results
uses: dorny/test-reporter@v1
if: |
${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} &&
(success() || failure())
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Cart-Service-Unit-Test-Results
path: "cart/**/surefire-reports/*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -pl cart -am
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/customer-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,15 +32,13 @@ jobs:
run: mvn test -f customer
- name: Unit Test Results
uses: dorny/test-reporter@v1
if: |
${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} &&
(success() || failure())
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Customer-Service-Unit-Test-Results
path: "customer/**/surefire-reports/*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f customer
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/inventory-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,15 +32,13 @@ jobs:
run: mvn test -f inventory
- name: Unit Test Results
uses: dorny/test-reporter@v1
if: |
${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} &&
(success() || failure())
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Inventory-Service-Unit-Test-Results
path: "inventory/**/surefire-reports/*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f inventory
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/location-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,15 +32,13 @@ jobs:
run: mvn test -f location
- name: Unit Test Results
uses: dorny/test-reporter@v1
if: |
${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} &&
(success() || failure())
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Location-Service-Unit-Test-Results
path: "location/**/surefire-reports/*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f location
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/media-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,15 +32,13 @@ jobs:
run: mvn test -f media
- name: Unit Test Results
uses: dorny/test-reporter@v1
if: |
${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} &&
(success() || failure())
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Media-Service-Unit-Test-Results
path: "media/**/surefire-reports/*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f media
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/order-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,15 +32,13 @@ jobs:
run: mvn test -pl order -am
- name: Unit Test Results
uses: dorny/test-reporter@v1
if: |
${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} &&
(success() || failure())
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Order-Service-Unit-Test-Results
path: "order/**/surefire-reports/*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f order
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/payment-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,15 +32,13 @@ jobs:
run: mvn test -pl payment -am
- name: Unit Test Results
uses: dorny/test-reporter@v1
if: |
${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} &&
(success() || failure())
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Payment-Service-Unit-Test-Results
path: "payment/**/surefire-reports/*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f payment
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/payment-paypal-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,15 +32,13 @@ jobs:
run: mvn test -f payment-paypal
- name: Unit Test Results
uses: dorny/test-reporter@v1
if: |
${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} &&
(success() || failure())
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Payment-Paypal-Unit-Test-Results
path: "payment-paypal/**/surefire-reports/*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f payment-paypal
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/product-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,15 +32,13 @@ jobs:
run: mvn test -pl product -am
- name: Unit Test Results
uses: dorny/test-reporter@v1
if: |
${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} &&
(success() || failure())
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Product-Service-Unit-Test-Results
path: "product/**/surefire-reports/*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f product
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/promotion-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,15 +32,13 @@ jobs:
run: mvn test -f promotion
- name: Unit Test Results
uses: dorny/test-reporter@v1
if: |
${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} &&
(success() || failure())
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Promotion-Service-Unit-Test-Results
path: "promotion/**/surefire-reports/*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f promotion
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/rating-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,15 +32,13 @@ jobs:
run: mvn test -f rating
- name: Unit Test Results
uses: dorny/test-reporter@v1
if: |
${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} &&
(success() || failure())
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Rating-Service-Unit-Test-Results
path: "rating/**/surefire-reports/*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f rating
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/search-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -30,15 +32,13 @@ jobs:
run: mvn test -f search
- name: Unit Test Results
uses: dorny/test-reporter@v1
if: |
${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} &&
(success() || failure())
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Search-Service-Unit-Test-Results
path: "search/**/surefire-reports/*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f search
Expand Down
Loading
Loading