Fix Actions workflow, add SonarCloud
This commit is contained in:
parent
ab3aa4e391
commit
765fc8963e
23
.github/workflows/php.yml
vendored
23
.github/workflows/php.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@master
|
uses: shivammathur/setup-php@master
|
||||||
@ -32,23 +32,24 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: composer install --prefer-dist --no-progress --no-suggest
|
run: composer install --prefer-dist --no-progress --no-suggest
|
||||||
|
|
||||||
- name: Install tools
|
- name: Install tools
|
||||||
run: ./scripts/install_tools.sh
|
run: ./scripts/install_tools.sh
|
||||||
|
|
||||||
- name: Run test suite
|
- name: Run test suite
|
||||||
run: composer run-script test
|
run: composer run-script test
|
||||||
|
|
||||||
scrutinizer-ci:
|
sonarcloud:
|
||||||
|
name: "SonarCloud"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@master
|
uses: shivammathur/setup-php@master
|
||||||
with:
|
with:
|
||||||
php-version: 7.4
|
php-version: 7.4
|
||||||
extension-csv: mbstring, xdebug, dom, intl
|
extension-csv: mbstring, dom, intl
|
||||||
coverage: xdebug
|
coverage: pcov
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: composer install --prefer-dist --no-progress --no-suggest
|
run: composer install --prefer-dist --no-progress --no-suggest
|
||||||
@ -57,17 +58,17 @@ jobs:
|
|||||||
run: ./scripts/install_tools.sh
|
run: ./scripts/install_tools.sh
|
||||||
|
|
||||||
- name: Run test suite
|
- name: Run test suite
|
||||||
run: composer run-script test -- --coverage-clover=coverage.clover
|
run: composer run-script test -- --coverage-clover=coverage.clover --log-junit=test-report.xml
|
||||||
|
|
||||||
- run: wget https://scrutinizer-ci.com/ocular.phar
|
# https://community.sonarsource.com/t/code-coverage-doesnt-work-with-github-action/16747/5
|
||||||
- name: Upload code coverage
|
- name: fix code coverage paths
|
||||||
run: php ocular.phar code-coverage:upload --format=php-clover coverage.clover
|
run: sed -i 's/\/home\/runner\/work\/daux.io\/daux.io\//\/github\/workspace\//g' coverage.clover
|
||||||
|
|
||||||
documentation:
|
documentation:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.repository == 'dauxio/daux.io' && github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
|
if: github.repository == 'dauxio/daux.io' && github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: composer install --prefer-dist --no-progress --no-suggest
|
run: composer install --prefer-dist --no-progress --no-suggest
|
||||||
- name: Generate documentation
|
- name: Generate documentation
|
||||||
|
10
sonar-project.properties
Normal file
10
sonar-project.properties
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
sonar.projectKey=dauxio_daux.io
|
||||||
|
sonar.organization=daux
|
||||||
|
sonar.projectName=Daux.io
|
||||||
|
|
||||||
|
sonar.sources=.
|
||||||
|
sonar.exclusions=vendor/**,tests/**
|
||||||
|
sonar.test.inclusions=tests/**
|
||||||
|
|
||||||
|
sonar.php.coverage.reportPaths=coverage.clover
|
||||||
|
sonar.php.tests.reportPath=test-report.xml
|
Loading…
Reference in New Issue
Block a user