diff --git a/.github/workflows/github-actions.js.yml b/.github/workflows/github-actions.js.yml index f71acf1..68e2dc1 100644 --- a/.github/workflows/github-actions.js.yml +++ b/.github/workflows/github-actions.js.yml @@ -13,28 +13,7 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains multiple jobs - SonarCloud: - name: Sonarcloud - runs-on: ubuntu-latest - environment: Production - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - name: SonarQube Quality Gate check - uses: sonarsource/sonarqube-quality-gate-action@master - # Force to fail step after specific time - timeout-minutes: 5 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - Build_app: + Build_App: # The type of runner that the job will run on runs-on: ubuntu-latest environment: Production @@ -62,18 +41,40 @@ jobs: - name: Build the app run: | yarn build - - Vercel_deploy: + + # This workflow contains multiple jobs + Sonar_Cloud: + name: Sonarcloud + needs: Build_App runs-on: ubuntu-latest environment: Production steps: - - uses: actions/checkout@v2 - - uses: amondnet/vercel-action@v20 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - vercel-token: ${{ secrets.VERCEL_TOKEN }} - vercel-args: '--prod' - vercel-org-id: ${{ secrets.VERCEL_ORGANIZATION_ID }} #Required - vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} #Required - working-directory: ./ #Your Working Directory, Optional - + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: SonarQube Quality Gate check + uses: sonarsource/sonarqube-quality-gate-action@master + # Force to fail step after specific time + timeout-minutes: 5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + Vercel_Deploy: + runs-on: ubuntu-latest + needs: Sonar_Cloud + environment: Production + steps: + - uses: actions/checkout@v2 + - uses: amondnet/vercel-action@v20 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + vercel-token: ${{ secrets.VERCEL_TOKEN }} + vercel-args: '--prod' + vercel-org-id: ${{ secrets.VERCEL_ORGANIZATION_ID }} #Required + vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} #Required + working-directory: ./ #Your Working Directory, Optional diff --git a/sonar-project.properties b/sonar-project.properties index 7275c1a..6037ac1 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,2 +1,3 @@ sonar.organization=lucasmsa -sonar.projectKey=lucasmsa_hiit-maker \ No newline at end of file +sonar.projectKey=lucasmsa_hiit-maker +sonar.coverage=** \ No newline at end of file