From 30914a6eda99742d2829db9c8aad5209ff907959 Mon Sep 17 00:00:00 2001 From: Matheus Melo Date: Tue, 10 Dec 2024 13:15:58 -0300 Subject: [PATCH] ci: separate build and quality gates --- .github/workflows/{ci.yaml => build.yaml} | 19 ++----------------- .github/workflows/quality-gate.yaml | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 17 deletions(-) rename .github/workflows/{ci.yaml => build.yaml} (58%) create mode 100644 .github/workflows/quality-gate.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/build.yaml similarity index 58% rename from .github/workflows/ci.yaml rename to .github/workflows/build.yaml index 8918820..0c90339 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/build.yaml @@ -1,24 +1,9 @@ -name: ci-node-workflow +name: ci-build on: pull_request: branches: - - develop + - main jobs: - sonarcloud: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-node@v4 - with: - node-version: 22 - - run: npm run test:cov - - name: SonarQube Scan - uses: sonarsource/sonarqube-scan-action@v4.1.0 # Ex: v2.1.0, See the latest version at https://github.com/marketplace/actions/official-sonarqube-scan - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} check-application: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/quality-gate.yaml b/.github/workflows/quality-gate.yaml new file mode 100644 index 0000000..9de5336 --- /dev/null +++ b/.github/workflows/quality-gate.yaml @@ -0,0 +1,22 @@ +name: ci-sonarcloud +on: + pull_request: + branches: + - develop + - main +jobs: + sonarcloud: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - run: npm run test:cov + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@v4.1.0 # Ex: v2.1.0, See the latest version at https://github.com/marketplace/actions/official-sonarqube-scan + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}