Skip to content

sonar-project.properties #12

sonar-project.properties

sonar-project.properties #12

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: Test and Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mbstring, xml, json
coverage: xdebug
- name: Install dependencies
run: make install
- name: Run lint
run: make lint
- name: Run tests
run: make test
- name: Upload coverage to SonarCloud
run: |
composer require --dev php-coveralls/php-coveralls
vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
sonarqube:
name: SonarQube Analysis
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mbstring, xml, json
- name: Install dependencies
run: make install
- name: Run tests with coverage
run: vendor/bin/phpunit --coverage-clover coverage.clover
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}