diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 6e055de29..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,20 +0,0 @@ -on: - push: - branches: - - "*.*.x" - pull_request: - types: [opened, synchronize, reopened] -name: SonarCloud Main Workflow -jobs: - sonarcloud: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - # Disabling shallow clone is recommended for improving relevancy of reporting - fetch-depth: 0 - - name: SonarCloud Scan - uses: sonarsource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index 43bde46db..396609d14 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -6,7 +6,8 @@ on: push: branches: - "*.*.x" - pull_request: null + pull_request: + types: [opened, synchronize, reopened] jobs: byte_level: @@ -70,6 +71,8 @@ jobs: - name: "Checkout code" uses: "actions/checkout@v3.5.2" + with: + fetch-depth: 0 - name: "Install dependencies" uses: "ramsey/composer-install@v2" @@ -83,13 +86,14 @@ jobs: - name: "Execute tests (JS)" run: "make js" - # - name: Send coverage to Coveralls - # if: "matrix.php-version == '8.1' && matrix.dependencies == 'highest'" - # env: - # COVERALLS_REPO_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - # run: | - # wget "https://github.com/php-coveralls/php-coveralls/releases/download/v2.5.2/php-coveralls.phar" - # php ./php-coveralls.phar -v + - name: "Fix code coverage paths" + run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml + + - name: "SonarCloud Scan" + uses: "sonarsource/sonarcloud-github-action@master" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} static_analysis: name: "3️⃣ Static Analysis" diff --git a/Makefile b/Makefile index 2c74897c1..4cc561284 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ ci-mu: vendor ## Mutation tests (for CI/CD only) .PHONY: ci-cc ci-cc: vendor ## Show test coverage rates (for CI/CD only) - vendor/bin/phpunit --coverage-text + XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml .PHONY: ci-cs ci-cs: vendor ## Check all files using defined ECS rules (for CI/CD only) diff --git a/sonar-project.properties b/sonar-project.properties index 4242fb677..83c2ad985 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,3 +1,4 @@ sonar.organization=web-auth sonar.projectKey=web-auth_webauthn-framework +sonar.php.coverage.reportPaths=coverage.xml sonar.sources=.