Skip to content

Commit

Permalink
Install static analyser. Run it in the pipeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
DvDty committed Jan 28, 2024
1 parent 7ecb467 commit 87a4599
Show file tree
Hide file tree
Showing 3 changed files with 288 additions and 7 deletions.
41 changes: 35 additions & 6 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,46 @@ jobs:
# working-directory: ./application
# run: php artisan test

SonarCloud:
static-analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Analyze
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ./application/vendor
key: composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer:v2
coverage: none

- name: Install Project Dependencies
working-directory: ./application
run: composer install

- name: Run static analyser
working-directory: ./application
run: ./vendor/bin/phpstan analyze app/

# SonarCloud:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
#
# - name: Analyze
# uses: SonarSource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}

# build-check-push-image:
# runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions application/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"require-dev": {
"fakerphp/faker": "^1.9.1",
"friendsofphp/php-cs-fixer": "^3.48",
"larastan/larastan": "^2.8",
"laravel/pint": "^1.0",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
Expand Down
253 changes: 252 additions & 1 deletion application/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 87a4599

Please sign in to comment.