firefly-iii/.github/workflows/sonarcloud.yml

80 lines
1.9 KiB
YAML
Raw Normal View History

2023-10-22 01:22:53 -05:00
name: 'Code - Run Sonarcloud'
on:
2023-10-22 01:22:53 -05:00
pull_request:
2023-10-28 10:38:42 -05:00
workflow_dispatch:
push:
branches:
- main
- develop
env:
DB_CONNECTION: sqlite
2023-10-29 11:57:27 -05:00
APP_KEY: UfpBqqeXx7zpNodsC6yjYQcRfDdm4Bxh
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
2023-07-03 09:37:11 -05:00
- name: Checkout
2023-10-29 11:52:01 -05:00
uses: actions/checkout@v3
2023-07-03 09:37:11 -05:00
with:
fetch-depth: 0
- name: Setup PHP with Xdebug
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: xdebug
extensions: >-
bcmath
curl
fileinfo
iconv
intl
json
sqlite3
mbstring
openssl
pdo
session
simplexml
sodium
tokenizer
xml
xmlwriter
2023-07-03 09:37:11 -05:00
2023-10-30 00:04:34 -05:00
- name: Copy standard configuration
run: cp .env.testing .env
2023-10-30 00:04:34 -05:00
2023-07-03 09:37:11 -05:00
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-progress --no-scripts
2023-11-04 05:33:42 -05:00
- name: PHPStan
2023-11-04 05:41:21 -05:00
run: .ci/phpstan.sh
2023-11-04 05:33:42 -05:00
2023-11-04 06:20:18 -05:00
- name: PHPMD
run: .ci/phpmd.sh
2023-11-04 08:09:51 -05:00
- name: PHP CS Fixer
run: .ci/phpcs.sh
- name: "Create database file"
run: touch storage/database/database.sqlite
- name: "Upgrades the database to the latest version"
run: php artisan firefly-iii:upgrade-database
- name: "Integrity Database Report"
run: php artisan firefly-iii:report-integrity
2023-07-03 09:37:11 -05:00
- name: "Run tests with coverage"
run: composer coverage
- 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.GH_ACTIONS_PERSONAL_ACCESS_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}