From 30428741d562dc0760ce24de469104e9d228d814 Mon Sep 17 00:00:00 2001 From: Syifa Date: Fri, 9 Jan 2026 09:09:51 +0700 Subject: [PATCH] update pipeline and added coverage test --- .gitea/workflows/testing.yaml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/testing.yaml b/.gitea/workflows/testing.yaml index 7918687..9668ead 100644 --- a/.gitea/workflows/testing.yaml +++ b/.gitea/workflows/testing.yaml @@ -13,9 +13,17 @@ jobs: - name: Checkout source code uses: actions/checkout@v4 - - name: Set image tag - run: | - echo "IMAGE_TAG=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm install + + - name: Run tests with coverage + run: npm test - name: SonarQube Scan uses: sonarsource/sonarqube-scan-action@v2 @@ -24,12 +32,13 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND_TEST }} with: args: > - -Dsonar.projectKey=csa-backend-production + -Dsonar.projectKey=csa-backend-test -Dsonar.sources=. + -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info - name: SonarQube Quality Gate uses: sonarsource/sonarqube-quality-gate-action@v1 timeout-minutes: 5 env: SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND_TEST }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND_TEST }} \ No newline at end of file