Skip to content

Commit

Permalink
Code Coverage for Sonarcloud (#453)
Browse files Browse the repository at this point in the history
* Code Coverage for Sonarcloud
  • Loading branch information
Spomky authored Jul 27, 2023
1 parent 080b81d commit 5f1eefd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 29 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/build.yml

This file was deleted.

20 changes: 12 additions & 8 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
push:
branches:
- "*.*.x"
pull_request: null
pull_request:
types: [opened, synchronize, reopened]

jobs:
byte_level:
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sonar.organization=web-auth
sonar.projectKey=web-auth_webauthn-framework
sonar.php.coverage.reportPaths=coverage.xml
sonar.sources=.

0 comments on commit 5f1eefd

Please sign in to comment.