Skip to content

Commit

Permalink
refactored workflow into separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
Koufan-De-King committed Nov 25, 2024
1 parent fad64e0 commit 1f4b972
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 9 deletions.
File renamed without changes.
15 changes: 10 additions & 5 deletions .github/workflows/main-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,25 @@ jobs:

lint:
needs: install
uses: ./.github/workflows/analyses/linting.yml
uses: ./.github/workflows/linting.yml

prettier:
needs: install
uses: ./.github/workflows/analyses/prettier.yml
uses: ./.github/workflows/prettier.yml

typescript:
needs: install
uses: ./.github/workflows/analyses/typescript.yml
uses: ./.github/workflows/typescript.yml

unit_tests:
needs: install
uses: ./.github/workflows/analyses/tests.yml
uses: ./.github/workflows/tests.yml

sonarqube:
needs: [build, unit_tests]
uses: ./.github/workflows/analyses/sonarqube.yml
uses: ./.github/workflows/sonarqube.yml
with:
SONAR_TOKEN: ${{ github.secret_source.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ github.secret_source.SONAR_HOST_URL }}


File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ name: SonarQube Analyses

on:
workflow_call:

inputs:
SONAR_TOKEN:
required: true
type: string
SONAR_HOST_URL:
required: true
type: string

jobs:
sonarqube:
runs-on: ubuntu-latest
Expand All @@ -17,15 +24,17 @@ jobs:
path: coverage
- uses: sonarsource/sonarqube-scan-action@v3
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_TOKEN: ${{ inputs.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ inputs.SONAR_HOST_URL }}
with:
args: |
-Dsonar.projectKey=Webank-Userapp
-Dsonar.source=src
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.qualitygate.wait=true
- uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_TOKEN: ${{ inputs.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ inputs.SONAR_HOST_URL }}
File renamed without changes.
File renamed without changes.

0 comments on commit 1f4b972

Please sign in to comment.