diff --git a/.github/workflows/github-ci-sonar.yml b/.github/workflows/github-ci-sonar.yml new file mode 100644 index 0000000000000000000000000000000000000000..4be1e09f3b6884a0d3d5ee10b7bee9ad1d81338f --- /dev/null +++ b/.github/workflows/github-ci-sonar.yml @@ -0,0 +1,40 @@ +name: Run tests and Sonar update + +on: + push: + branches: + - develop + +jobs: + run-sonar: + runs-on: ubuntu-22.04 + + container: + image: docker://trion/ng-cli-karma:14.2.1 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set execute permissions for gradlew + run: chmod +x ./gradlew + + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: '11' + + - name: Install dependencies + run: npm ci --force + + - name: Check test coverage + run: ./gradlew testCoverage + + - name: Run Sonar update + env: + SONAR_LOGIN_TOKEN: ${{ secrets.SONAR_LOGIN_TOKEN }} + SONAR_HOST: ${{ vars.SONAR_HOST }} + SONAR_PROJECT_KEY: ${{ vars.SONAR_PROJECT_KEY }} + SONAR_PROJECT_NAME: ${{ vars.SONAR_PROJECT_NAME }} + SONAR_BRANCH: ${{ github.ref_name }} + run: ./gradlew -Dsonar.host.url=${SONAR_HOST} -Dsonar.projectKey=${SONAR_PROJECT_KEY} -Dsonar.projectName=${SONAR_PROJECT_NAME} -Dsonar.branch.name=${SONAR_BRANCH} -Dsonar.login=${SONAR_LOGIN_TOKEN} sonarqube diff --git a/build.gradle b/build.gradle index 97f6faa619bc9f22c75c89f3a57e077adc9f05f9..7607b9657594de0a99330b121e2754e13c67ac43 100644 --- a/build.gradle +++ b/build.gradle @@ -52,7 +52,6 @@ task testCoverage(type: Exec) { commandLine 'ng', 'test', '--browsers', 'Chromium', '--watch=false', '--code-coverage', '--source-map=false' } - dependsOn(npm_install) } sonarqube {