ci: add compser test:coverage to script section (#1110) #474
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sonar Cloud | |
on: | |
push: | |
branches: | |
- main | |
- sonarqube | |
jobs: | |
Sonar-cloud: | |
name: Sonar Cloud | |
runs-on: ubuntu-18.04 | |
steps: | |
- name: Start database server | |
run: sudo /etc/init.d/mysql start | |
- uses: actions/checkout@v4 | |
- id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
- run: | | |
if [ -n "${{ secrets.SONAR_TOKEN }}" ]; then | |
composer require --dev nimut/typo3-complete:^11.4 nimut/phpunit-merger:^1.1 --no-progress | |
export "TYPO3_PATH_WEB"=$PWD/.Build/Web; | |
export "UNIT_XML"='Tests/UnitTests.xml' | |
export "FUNCTIONAL_XML"='Tests/FunctionalTests.xml' | |
mkdir -p .Logs/coverage .Logs/junit | |
.Build/bin/phpunit --coverage-php .Logs/coverage/unit_clover.cov --log-junit .Logs/junit/unit_junit.xml -c $UNIT_XML Tests/Unit | |
.Build/bin/phpunit --coverage-php .Logs/coverage/functional-coverage.cov --log-junit .Logs/junit/functional-junit.xml -c $FUNCTIONAL_XML Tests/Functional | |
.Build/bin/phpunit-merger coverage .Logs/coverage/ .Logs/coverage.xml; | |
.Build/bin/phpunit-merger log .Logs/junit/ .Logs/junit.xml; | |
fi | |
env: | |
typo3DatabaseHost: 127.0.0.1 | |
typo3DatabaseName: typo3 | |
typo3DatabasePassword: root | |
typo3DatabaseUsername: root | |
- name: Setup sonarqube | |
uses: warchant/setup-sonar-scanner@v3 | |
- name: Run sonarqube | |
env: | |
# to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN | |
GITHUB_TOKEN: ${{ secrets.CRAWLER_GITHUB_TOKEN }} | |
run: sonar-scanner | |
-Dsonar.login=${{ secrets.SONAR_TOKEN }} | |
-Dsonar.host.url=https://sonarcloud.io/ | |
-Dsonar.organization="aoe-crawler" | |