Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
54596fb
edit file in customer service
dorayakiiiiz Apr 11, 2026
9c56196
edit file in customer service
dorayakiiiiz Apr 11, 2026
e71d914
test customer CI pipeline
dorayakiiiiz Apr 12, 2026
94a99fb
test customer CI pipeline
dorayakiiiiz Apr 12, 2026
2bb9f17
test customer CI pipeline
dorayakiiiiz Apr 12, 2026
f615fa3
test customer CI pipeline
dorayakiiiiz Apr 12, 2026
feaf588
test customer CI pipeline
dorayakiiiiz Apr 12, 2026
3e09152
test customer CI pipeline
dorayakiiiiz Apr 12, 2026
71c012f
test customer CI pipeline
dorayakiiiiz Apr 12, 2026
16fce25
test customer CI pipeline
dorayakiiiiz Apr 12, 2026
a5c3b6f
test customer CI pipeline
dorayakiiiiz Apr 12, 2026
f5ab412
test customer CI pipeline
dorayakiiiiz Apr 12, 2026
102b958
test customer CI pipeline
dorayakiiiiz Apr 12, 2026
fb607c2
test customer CI pipeline
dorayakiiiiz Apr 12, 2026
f0ebadd
test customer CI pipeline
dorayakiiiiz Apr 12, 2026
d4358f1
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
aec0b4c
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
bbc2b37
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
a68f006
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
c6f6212
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
9309bba
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
a306289
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
1a521b7
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
3444f3a
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
bc58ca8
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
d9a953e
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
9ffc94a
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
570eada
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
aacc30f
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
527f4d6
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
17da1db
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
cdc75c3
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
01a657c
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
0e278d9
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
ff4112b
test customer CI pipeline
dorayakiiiiz Apr 13, 2026
e91e546
add test and fix security error
dorayakiiiiz Apr 13, 2026
bbccd69
add test and fix security error
dorayakiiiiz Apr 13, 2026
5839da7
add test and fix security error
dorayakiiiiz Apr 13, 2026
f62909f
add test and fix security error
dorayakiiiiz Apr 13, 2026
e5faaa8
add test and fix security error
dorayakiiiiz Apr 13, 2026
90b92e5
add test and fix security error
dorayakiiiiz Apr 13, 2026
684b7d3
add test and fix security error
dorayakiiiiz Apr 13, 2026
990bfba
add test and fix security error
dorayakiiiiz Apr 13, 2026
e2e1634
add test and fix security error
dorayakiiiiz Apr 13, 2026
561aa4e
add test and fix security error
dorayakiiiiz Apr 13, 2026
68c6802
add test and fix security error
dorayakiiiiz Apr 13, 2026
3b13030
add test and fix security error
dorayakiiiiz Apr 13, 2026
d16685a
add test and fix security error
dorayakiiiiz Apr 13, 2026
8618787
add test and fix security error
dorayakiiiiz Apr 13, 2026
62ef3b0
Merge pull request #12 from dorayakiiiiz/feat/customer
dorayakiiiiz Apr 13, 2026
15d4d4c
add git leak checking in customer-ci.yaml
dorayakiiiiz Apr 26, 2026
f27c340
add git leak checking in customer-ci.yaml
dorayakiiiiz Apr 26, 2026
f461cf5
add git leak checking in customer-ci.yaml
dorayakiiiiz Apr 26, 2026
19120db
add git leak checking in customer-ci.yaml
dorayakiiiiz Apr 26, 2026
5f039a4
add git leak checking in customer-ci.yaml
dorayakiiiiz Apr 26, 2026
c109de8
feat/promotion
dorayakiiiiz Apr 26, 2026
182bee2
feat/customer
dorayakiiiiz Apr 26, 2026
f56d5a1
feat/promotion
dorayakiiiiz Apr 26, 2026
bc61eed
feat/promotion
dorayakiiiiz Apr 26, 2026
79c1678
feat/promotion
dorayakiiiiz Apr 26, 2026
6fa3574
config promotion ci
dorayakiiiiz Apr 26, 2026
e4d1a1c
config customer ci pipeline
dorayakiiiiz Apr 26, 2026
102ae62
config promotion ci pipeline
dorayakiiiiz Apr 26, 2026
558d775
config promotion ci pipeline
dorayakiiiiz Apr 26, 2026
108a202
config promotion ci pipeline
dorayakiiiiz Apr 26, 2026
0def2d6
Merge pull request #45 from dorayakiiiiz/feat/customer
dorayakiiiiz Apr 26, 2026
db5a1b1
Merge pull request #43 from dorayakiiiiz/feat/promotion
dorayakiiiiz Apr 26, 2026
cbc4db5
feat(cart): add unit tests, coverage gate 70%, and snyk scan
HuynhDucThinh Apr 27, 2026
28ef974
chore: remove de-bai.txt from repo and add to gitignore
HuynhDucThinh Apr 27, 2026
1d45cd3
fix: restructure cart-ci into test+build jobs, fix triggers and cover…
HuynhDucThinh Apr 27, 2026
f8fad14
fix: update sonarcloud org and project key for cart
HuynhDucThinh Apr 27, 2026
3338603
fix: replace snyk maven action with setup+run to fix JAVA_HOME error
HuynhDucThinh Apr 27, 2026
9b20d27
fix: add continue-on-error and memory limit for snyk scan
HuynhDucThinh Apr 27, 2026
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
92 changes: 56 additions & 36 deletions .github/workflows/cart-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: cart service ci

on:
push:
branches: [ "main" ]
branches: ["**"]
paths:
- "cart/**"
- ".github/workflows/actions/action.yaml"
- ".github/workflows/cart-ci.yaml"
- "pom.xml"
pull_request:
branches: [ "main" ]
branches: ["main"]
paths:
- "cart/**"
- ".github/workflows/actions/action.yaml"
Expand All @@ -18,62 +18,82 @@ on:
workflow_dispatch:

jobs:
Build:
test:
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@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -pl cart -am
- name: Run Maven Checkstyle
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
run: mvn checkstyle:checkstyle -pl cart -am -Dcheckstyle.output.file=cart-checkstyle-result.xml
- name: Upload Checkstyle Result
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/cart-checkstyle-result.xml'
- name: Run Maven Test
run: mvn -pl cart -am verify # Chạy test và sinh JaCoCo report
- name: Install Dependencies
run: mvn -pl cart -am install -DskipTests
- name: Test Results
uses: dorny/test-reporter@v1
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Cart-Service-Unit-Test-Results
path: "cart/**/*-reports/TEST*.xml"
reporter: java-junit
- name: OWASP Dependency Check
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
uses: dependency-check/Dependency-Check_Action@main
env:
JAVA_HOME: /opt/jdk
with:
project: 'yas'
path: '.'
format: 'HTML'
- name: Upload OWASP Dependency Check results
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
uses: actions/upload-artifact@master
with:
name: OWASP Dependency Check Report
path: ${{github.workspace}}/reports
- name: Analyze with sonar cloud
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
- name: Add coverage report to PR
uses: madrapps/jacoco-report@v1.6.1
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
with:
paths: ${{github.workspace}}/cart/target/site/jacoco/jacoco.xml
token: ${{secrets.GITHUB_TOKEN}}
min-coverage-overall: 80
min-coverage-overall: 70
min-coverage-changed-files: 60
title: 'Cart Coverage Report'
update-comment: true
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: cart-coverage-report
path: ${{github.workspace}}/cart/target/site/jacoco/
- name: Gitleaks check (Service Level)
run: |
docker run --rm -v ${{ github.workspace }}:/work -w /work zricethezav/gitleaks:v8.18.4 detect --source="./cart" --no-git --verbose

build:
runs-on: ubuntu-latest
needs: test
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/workflows/actions
- name: Run Maven Build
run: mvn -pl cart -am -DskipTests install

- name: Run Maven Checkstyle
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
run: mvn checkstyle:checkstyle -pl cart -am -Dcheckstyle.output.file=cart-checkstyle-result.xml
- name: Upload Checkstyle Result
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/cart-checkstyle-result.xml'
- name: Analyze with sonar cloud
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f cart

- name: Setup Snyk
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
uses: snyk/actions/setup@master
- name: Snyk Security Scan
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
MAVEN_OPTS: "-Xmx512m"
run: snyk test --file=cart/pom.xml --severity-threshold=high --project-name=yas-cart
- name: Log in to the Container registry
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/login-action@v3
Expand All @@ -87,4 +107,4 @@ jobs:
with:
context: ./cart
push: true
tags: ghcr.io/nashtech-garage/yas-cart:latest
tags: ghcr.io/${{ github.repository_owner }}/yas-cart:latest
98 changes: 71 additions & 27 deletions .github/workflows/customer-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: customer service ci

on:
push:
branches: [ "main" ]
branches: ["**"]
paths:
- "customer/**"
- ".github/workflows/actions/action.yaml"
- ".github/workflows/customer-ci.yaml"
- "pom.xml"
pull_request:
branches: [ "main" ]
branches: ["main"]
paths:
- "customer/**"
- ".github/workflows/actions/action.yaml"
Expand All @@ -18,37 +18,67 @@ on:
workflow_dispatch:

jobs:
Build:
test:
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@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0
- uses: ./.github/workflows/actions
- name: Run Maven Build Command
run: mvn clean install -pl customer -am
- name: Run Maven Checkstyle
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
run: mvn checkstyle:checkstyle -pl customer -am -Dcheckstyle.output.file=customer-checkstyle-result.xml
- name: Upload Checkstyle Result
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/customer-checkstyle-result.xml'
- name: Run Maven Test
run: mvn -pl customer -am verify # Chạy test và sinh JaCoCo report
- name: Install Dependencies # Install JARs cho job build
run: mvn -pl customer -am install -DskipTests
- name: Test Results
uses: dorny/test-reporter@v1
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && (success() || failure()) }}
with:
name: Customer-Service-Unit-Test-Results
path: "customer/**/*-reports/TEST*.xml"
reporter: java-junit
- name: Analyze with sonar cloud
- name: Add coverage report to PR
uses: madrapps/jacoco-report@v1.6.1
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f customer
with:
paths: ${{github.workspace}}/customer/target/site/jacoco/jacoco.xml
token: ${{secrets.GITHUB_TOKEN}}
min-coverage-overall: 70 # Gate coverage > 70%
min-coverage-changed-files: 60
title: 'Customer Coverage Report'
update-comment: true
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: customer-coverage-report
path: ${{github.workspace}}/customer/target/site/jacoco/
- name: Gitleaks check (Service Level)
run: |
docker run --rm -v ${{ github.workspace }}:/work -w /work zricethezav/gitleaks:v8.18.4 detect --source="./customer" --no-git --verbose

build:
runs-on: ubuntu-latest
needs: test
env:
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/workflows/actions
- name: Run Maven Build
run: mvn -pl customer -am -DskipTests install
# build without running test again

- name: Run Maven Checkstyle
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
run: mvn checkstyle:checkstyle -pl customer -am -Dcheckstyle.output.file=customer-checkstyle-result.xml
- name: Upload Checkstyle Result
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
uses: jwgmeligmeyling/checkstyle-github-action@master
with:
path: '**/customer-checkstyle-result.xml'
- name: OWASP Dependency Check
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
uses: dependency-check/Dependency-Check_Action@main
Expand All @@ -58,22 +88,36 @@ jobs:
project: 'yas'
path: '.'
format: 'HTML'
args: >
--disableCentral
--failOnCVSS 11
- name: Upload OWASP Dependency Check results
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
uses: actions/upload-artifact@master
with:
name: OWASP Dependency Check Report
path: ${{github.workspace}}/reports
- name: Add coverage report to PR
uses: madrapps/jacoco-report@v1.6.1
- name: Analyze with sonar cloud
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -f customer

- name: Setup Snyk
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
uses: snyk/actions/setup@master

- name: Run Snyk Scan (Code Quality & Security)
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }}
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: snyk code test ./customer --severity-threshold=medium --sarif-file-output=snyk-results.sarif

- name: Upload Snyk results
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' && !cancelled() }}
uses: github/codeql-action/upload-sarif@v3
with:
paths: ${{github.workspace}}/customer/target/site/jacoco/jacoco.xml
token: ${{secrets.GITHUB_TOKEN}}
min-coverage-overall: 80
min-coverage-changed-files: 60
title: 'Customer Coverage Report'
update-comment: true
sarif_file: snyk-results.sarif
- name: Log in to the Container registry
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/login-action@v3
Expand All @@ -87,4 +131,4 @@ jobs:
with:
context: ./customer
push: true
tags: ghcr.io/nashtech-garage/yas-customer:latest
tags: ghcr.io/${{ github.repository_owner }}/yas-customer:latest
8 changes: 6 additions & 2 deletions .github/workflows/gitleaks-check.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: GitLeaks check nightly
on:
workflow_dispatch:
push:
branches: ["**"]
pull_request:
branches: ["main"]
schedule:
- cron: "0 0 * * *"
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
Expand Down
Loading