2023-10-22 01:22:53 -05:00
|
|
|
name: 'Code - Run Sonarcloud'
|
2023-06-02 22:52:50 -05:00
|
|
|
on:
|
2023-10-22 01:22:53 -05:00
|
|
|
pull_request:
|
2023-10-28 10:38:42 -05:00
|
|
|
workflow_dispatch:
|
2023-06-02 22:52:50 -05:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- develop
|
2023-10-20 17:00:45 -05:00
|
|
|
env:
|
2023-10-29 11:54:52 -05:00
|
|
|
DB_CONNECTION: sqlite
|
2023-10-29 11:57:27 -05:00
|
|
|
APP_KEY: UfpBqqeXx7zpNodsC6yjYQcRfDdm4Bxh
|
2023-06-02 22:52:50 -05:00
|
|
|
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
|
2023-10-20 17:00:45 -05:00
|
|
|
extensions: >-
|
|
|
|
bcmath
|
|
|
|
curl
|
|
|
|
fileinfo
|
|
|
|
iconv
|
|
|
|
intl
|
|
|
|
json
|
2023-10-29 11:54:52 -05:00
|
|
|
sqlite3
|
2023-10-20 17:00:45 -05:00
|
|
|
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
|
2023-10-30 00:19:14 -05:00
|
|
|
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
|
|
|
|
|
2023-10-29 11:54:52 -05:00
|
|
|
- name: "Create database file"
|
|
|
|
run: touch storage/database/database.sqlite
|
|
|
|
|
2023-10-20 17:00:45 -05:00
|
|
|
- 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
|
|
|
|
|
2023-06-02 22:52:50 -05:00
|
|
|
- name: SonarCloud Scan
|
|
|
|
uses: SonarSource/sonarcloud-github-action@master
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_PERSONAL_ACCESS_TOKEN }}
|
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|